From: Uwe Hermann Date: Sat, 23 Apr 2016 19:27:59 +0000 (+0200) Subject: scan(): Consistently start out with SR_ST_INACTIVE. X-Git-Tag: libsigrok-0.5.0~420 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=45884333ff8641c86d9808b46dde9f571083c10d scan(): Consistently start out with SR_ST_INACTIVE. A later call to open() will set the status to SR_ST_ACTIVE. Only in the case of firmware/bitstream upload start with SR_ST_INITIALIZING first. --- diff --git a/src/hardware/arachnid-labs-re-load-pro/api.c b/src/hardware/arachnid-labs-re-load-pro/api.c index 203515c0..248d6549 100644 --- a/src/hardware/arachnid-labs-re-load-pro/api.c +++ b/src/hardware/arachnid-labs-re-load-pro/api.c @@ -129,7 +129,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) } sdi = g_malloc0(sizeof(struct sr_dev_inst)); - sdi->status = SR_ST_ACTIVE; + sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup("Arachnid Labs"); sdi->model = g_strdup("Re:load Pro"); sdi->version = g_strdup(buf + 8); diff --git a/src/hardware/chronovu-la/api.c b/src/hardware/chronovu-la/api.c index c66783f6..ae326772 100644 --- a/src/hardware/chronovu-la/api.c +++ b/src/hardware/chronovu-la/api.c @@ -112,7 +112,7 @@ static int add_device(int model, struct libusb_device_descriptor *des, /* Register the device with libsigrok. */ sdi = g_malloc0(sizeof(struct sr_dev_inst)); - sdi->status = SR_ST_INITIALIZING; + sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup("ChronoVu"); sdi->model = g_strdup(devc->prof->modelname); sdi->serial_num = g_strdup(serial_num); diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c index 5328ccd1..708afa22 100644 --- a/src/hardware/conrad-digi-35-cpu/api.c +++ b/src/hardware/conrad-digi-35-cpu/api.c @@ -88,7 +88,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn); sdi = g_malloc0(sizeof(struct sr_dev_inst)); - sdi->status = SR_ST_ACTIVE; + sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup("Conrad"); sdi->model = g_strdup("DIGI 35 CPU"); sdi->conn = serial; diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index a84ee18b..0a220fe7 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -284,7 +284,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) devices = NULL; sdi = g_malloc0(sizeof(struct sr_dev_inst)); - sdi->status = SR_ST_ACTIVE; + sdi->status = SR_ST_INACTIVE; sdi->model = g_strdup("Demo device"); sdi->driver = di; diff --git a/src/hardware/ftdi-la/api.c b/src/hardware/ftdi-la/api.c index 4d39cd8f..c49c9c7d 100644 --- a/src/hardware/ftdi-la/api.c +++ b/src/hardware/ftdi-la/api.c @@ -148,7 +148,7 @@ static void scan_device(struct sr_dev_driver *di, struct libusb_device *dev, GSL /* Register the device with libsigrok. */ sdi = g_malloc0(sizeof(struct sr_dev_inst)); - sdi->status = SR_ST_INITIALIZING; + sdi->status = SR_ST_INACTIVE; sdi->vendor = vendor; sdi->model = model; sdi->serial_num = serial_num; diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 3111f53e..bb8689bd 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -114,7 +114,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) /* Register the device with libsigrok. */ sdi = g_malloc0(sizeof(struct sr_dev_inst)); - sdi->status = SR_ST_INITIALIZING; + sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup(USB_VENDOR_NAME); sdi->model = g_strdup(USB_MODEL_NAME); sdi->driver = di; diff --git a/src/hardware/maynuo-m97/api.c b/src/hardware/maynuo-m97/api.c index c2b77b80..7bf960d6 100644 --- a/src/hardware/maynuo-m97/api.c +++ b/src/hardware/maynuo-m97/api.c @@ -135,7 +135,7 @@ static struct sr_dev_inst *probe_device(struct sr_modbus_dev_inst *modbus) } sdi = g_malloc0(sizeof(struct sr_dev_inst)); - sdi->status = SR_ST_ACTIVE; + sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup("Maynuo"); sdi->model = g_strdup(model->name); sdi->version = g_strdup_printf("v%d.%d", version/10, version%10);