struct drv_context *drvc;
struct dev_context *devc;
struct sr_config *src;
- struct sr_probe *probe;
+ struct sr_channel *ch;
struct sr_serial_dev_inst *serial;
GSList *l, *devices;
const char *conn, *serialcomm;
sdi->conn = serial;
sdi->priv = devc;
sdi->driver = &gmc_mh_1x_2x_rs232_driver_info;
- if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+ if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
return NULL;
- sdi->probes = g_slist_append(sdi->probes, probe);
+ sdi->channels = g_slist_append(sdi->channels, ch);
drvc->instances = g_slist_append(drvc->instances, sdi);
devices = g_slist_append(devices, sdi);
}
struct drv_context *drvc;
struct dev_context *devc;
struct sr_config *src;
- struct sr_probe *probe;
+ struct sr_channel *ch;
struct sr_serial_dev_inst *serial;
GSList *l, *devices;
const char *conn, *serialcomm;
sdi->conn = serial;
sdi->priv = devc;
sdi->driver = &gmc_mh_2x_bd232_driver_info;
- if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+ if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
goto exit_err;
- sdi->probes = g_slist_append(sdi->probes, probe);
+ sdi->channels = g_slist_append(sdi->channels, ch);
drvc->instances = g_slist_append(drvc->instances, sdi);
devices = g_slist_append(devices, sdi);
->instances;
}
-static int dev_clear_1x_2x_rs232(void)
-{
- return std_dev_clear(&gmc_mh_1x_2x_rs232_driver_info, NULL);
-}
-
-static int dev_clear_2x_bd232(void)
-{
- return std_dev_clear(&gmc_mh_2x_bd232_driver_info, NULL);
-}
-
static int dev_close(struct sr_dev_inst *sdi)
{
struct dev_context *devc;
static int cleanup_sm_rs232(void)
{
- return dev_clear_1x_2x_rs232();
+ return std_dev_clear(&gmc_mh_1x_2x_rs232_driver_info, NULL);
}
static int cleanup_2x_bd232(void)
{
- return dev_clear_2x_bd232();
+ return std_dev_clear(&gmc_mh_2x_bd232_driver_info, NULL);
}
/** Get value of configuration item */
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_probe_group *probe_group)
+ const struct sr_channel_group *cg)
{
int ret;
struct dev_context *devc;
(void)sdi;
(void)data;
- (void)probe_group;
+ (void)cg;
ret = SR_OK;
- (void)probe_group;
+ (void)cg;
if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG;
/** Implementation of config_list, auxiliary function for common parts, */
static int config_list_common(int key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_probe_group *probe_group)
+ const struct sr_channel_group *cg)
{
(void)sdi;
- (void)probe_group;
+ (void)cg;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
/** Implementation of config_list for Metrahit 1x/2x send mode */
static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_probe_group *probe_group)
+ const struct sr_channel_group *cg)
{
(void)sdi;
- (void)probe_group;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t));
break;
default:
- return config_list_common(key, data, sdi, probe_group);
+ return config_list_common(key, data, sdi, cg);
}
return SR_OK;
/** Implementation of config_list for Metrahit 2x bidirectional mode */
static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_probe_group *probe_group)
+ const struct sr_channel_group *cg)
{
(void)sdi;
- (void)probe_group;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t));
break;
default:
- return config_list_common(key, data, sdi, probe_group);
+ return config_list_common(key, data, sdi, cg);
}
return SR_OK;
SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = {
.name = "gmc-mh-1x-2x-rs232",
- .longname = "Gossen Metrawatt Metrahit 1x/2x, 'RS232' interface",
+ .longname = "Gossen Metrawatt Metrahit 1x/2x, RS232 interface",
.api_version = 1,
.init = init_1x_2x_rs232,
.cleanup = cleanup_sm_rs232,
.scan = scan_1x_2x_rs232,
.dev_list = dev_list_1x_2x_rs232,
- .dev_clear = dev_clear_1x_2x_rs232,
+ .dev_clear = NULL,
.config_get = config_get,
.config_set = config_set,
.config_list = config_list_sm,
SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info = {
.name = "gmc-mh-2x-bd232",
- .longname = "Gossen Metrawatt Metrahit 2x, 'BD232'/'SI232-II' interface",
+ .longname = "Gossen Metrawatt Metrahit 2x, BD232/SI232-II interface",
.api_version = 1,
.init = init_2x_bd232,
.cleanup = cleanup_2x_bd232,
.scan = scan_2x_bd232,
.dev_list = dev_list_2x_bd232,
- .dev_clear = dev_clear_2x_bd232,
+ .dev_clear = NULL,
.config_get = config_get,
.config_set = config_set,
.config_list = config_list_bd,