X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fmanson-hcs-3xxx%2Fapi.c;h=f22d733461001689c268ec485d1131439d7edd06;hb=15f96409dc54fd2ef784c59156daedd9acfa78ed;hp=52695b0bfdb95b4511639e2e4d43ca4f74711ea5;hpb=dd5c48a6d567a3cac62c4b0058588273bbeea171;p=libsigrok.git diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c index 52695b0b..f22d7334 100644 --- a/src/hardware/manson-hcs-3xxx/api.c +++ b/src/hardware/manson-hcs-3xxx/api.c @@ -76,18 +76,14 @@ static const struct hcs_model models[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { int i, model_id; - struct drv_context *drvc; struct dev_context *devc; struct sr_dev_inst *sdi; struct sr_config *src; - GSList *devices, *l; + GSList *l; const char *conn, *serialcomm; struct sr_serial_dev_inst *serial; char reply[50], **tokens, *dummy; - drvc = di->context; - drvc->instances = NULL; - devices = NULL; conn = NULL; serialcomm = NULL; devc = NULL; @@ -147,7 +143,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->model = g_strdup(models[model_id].name); sdi->inst_type = SR_INST_SERIAL; sdi->conn = serial; - sdi->driver = di; sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "CH1"); @@ -178,14 +173,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) devc->voltage_max_device = g_strtod(tokens[0], &dummy) * devc->model->voltage[2]; g_strfreev(tokens); - drvc->instances = g_slist_append(drvc->instances, sdi); - devices = g_slist_append(devices, sdi); - serial_close(serial); - if (!devices) - sr_serial_dev_inst_free(serial); - return devices; + return std_scan_complete(di, g_slist_append(NULL, sdi)); exit_err: sr_dev_inst_free(sdi); @@ -366,7 +356,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) devc = sdi->priv; sr_sw_limits_acquisition_start(&devc->limits); - std_session_send_df_header(sdi, LOG_PREFIX); + std_session_send_df_header(sdi); devc->reply_pending = FALSE; devc->req_sent_at = 0; @@ -382,7 +372,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) static int dev_acquisition_stop(struct sr_dev_inst *sdi) { return std_serial_dev_acquisition_stop(sdi, - std_serial_dev_close, sdi->conn, LOG_PREFIX); + std_serial_dev_close); } static struct sr_dev_driver manson_hcs_3xxx_driver_info = {