*/
SR_API gboolean sr_dev_has_hwcap(const struct sr_dev *dev, int hwcap)
{
- int *hwcaps, i;
+ const int *hwcaps;
+ int i;
sr_spew("dev: %s: requesting hwcap %d", __func__, hwcap);
struct sr_analog_probe probes[];
};
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_SAMPLERATE,
SR_HWCAP_LIMIT_SAMPLES,
SR_HWCAP_CONTINUOUS,
return SR_ST_ACTIVE;
}
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
return hwcaps;
}
supported_samplerates,
};
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_LOGIC_ANALYZER,
SR_HWCAP_SAMPLERATE,
SR_HWCAP_CAPTURE_RATIO,
return SR_ST_NOT_FOUND;
}
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
return hwcaps;
}
};
/* Note: Continuous sampling is not supported by the hardware. */
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_LOGIC_ANALYZER,
SR_HWCAP_SAMPLERATE,
SR_HWCAP_LIMIT_MSEC, /* TODO: Not yet implemented. */
return sdi->status;
}
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
sr_spew("la8: Returning list of device capabilities.");
GTimer *timer;
};
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_LOGIC_ANALYZER,
SR_HWCAP_DEMO_DEV,
SR_HWCAP_SAMPLERATE,
return SR_ST_ACTIVE;
}
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
return hwcaps;
}
{ 0, 0, 0, 0, 0, 0, 0 }
};
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_LOGIC_ANALYZER,
SR_HWCAP_SAMPLERATE,
return sdi->status;
}
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
return hwcaps;
}
#define NUM_PROBES 8
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_LOGIC_ANALYZER,
// SR_HWCAP_OSCILLOSCOPE,
// SR_HWCAP_PAT_GENERATOR,
return sdi->status;
}
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
return hwcaps;
}
#define O_NONBLOCK FIONBIO
#endif
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_LOGIC_ANALYZER,
SR_HWCAP_SAMPLERATE,
SR_HWCAP_CAPTURE_RATIO,
return sdi->status;
}
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
return hwcaps;
}
{0x7016, "LAP-C(162000)", 16, 2048, 200},
};
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_LOGIC_ANALYZER,
SR_HWCAP_SAMPLERATE,
SR_HWCAP_PROBECONFIG,
return SR_ST_NOT_FOUND;
}
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
return hwcaps;
}
*/
SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap)
{
- int *hwcaps, i;
+ const int *hwcaps;
+ int i;
if (!driver) {
sr_err("hwdriver: %s: driver was NULL", __func__);
* @return A pointer to a struct with information about the parameter, or NULL
* if the capability was not found.
*/
-SR_API struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap)
+SR_API const struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap)
{
int i;
static char *sessionfile = NULL;
static GSList *dev_insts = NULL;
-static int hwcaps[] = {
+static const int hwcaps[] = {
SR_HWCAP_CAPTUREFILE,
SR_HWCAP_CAPTURE_UNITSIZE,
0,
return SR_OK;
}
-static void *hw_dev_info_get(int dev_index, int dev_info_id)
+static const void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct session_vdev *vdev;
void *info;
* @return A pointer to the (hardware) capabilities of this virtual session
* driver. This could be NULL, if no such capabilities exist.
*/
-static int *hw_hwcap_get_all(void)
+static const int *hw_hwcap_get_all(void)
{
return hwcaps;
}
SR_API struct sr_dev_driver **sr_driver_list(void);
SR_API int sr_driver_init(struct sr_dev_driver *driver);
SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap);
-SR_API struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap);
+SR_API const struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap);
/*--- session.c -------------------------------------------------------------*/
int (*dev_close) (int dev_index);
void *(*dev_info_get) (int dev_index, int dev_info_id);
int (*dev_status_get) (int dev_index);
- int *(*hwcap_get_all) (void);
+ const int *(*hwcap_get_all) (void);
int (*dev_config_set) (int dev_index, int hwcap, void *value);
int (*dev_acquisition_start) (int dev_index, void *session_dev_id);
int (*dev_acquisition_stop) (int dev_index, void *session_dev_id);