"fx2lafw-cwav-usbeesx.fw",
0, NULL, NULL},
+ /*
+ * CWAV USBee ZX
+ */
+ { 0x08a9, 0x0005, "CWAV", "USBee ZX", NULL,
+ "fx2lafw-cwav-usbeezx.fw",
+ 0, NULL, NULL},
+
/* DreamSourceLab DSLogic (before FW upload) */
{ 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL,
"dreamsourcelab-dslogic-fx2.fw",
SR_MHZ(400),
};
+static gboolean is_plausible(const struct libusb_device_descriptor *des)
+{
+ int i;
+
+ for (i = 0; supported_fx2[i].vid; i++) {
+ if (des->idVendor != supported_fx2[i].vid)
+ continue;
+ if (des->idProduct == supported_fx2[i].pid)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
struct drv_context *drvc;
libusb_get_device_descriptor( devlist[i], &des);
- if ((ret = libusb_open(devlist[i], &hdl)) < 0)
+ if (!is_plausible(&des))
continue;
+ if ((ret = libusb_open(devlist[i], &hdl)) < 0) {
+ sr_warn("Failed to open potential device with "
+ "VID:PID %04x:%04x: %s.", des.idVendor,
+ des.idProduct, libusb_error_name(ret));
+ continue;
+ }
+
if (des.iManufacturer == 0) {
manufacturer[0] = '\0';
} else if ((ret = libusb_get_string_descriptor_ascii(hdl,
des.idProduct == supported_fx2[j].pid &&
(!supported_fx2[j].usb_manufacturer ||
!strcmp(manufacturer, supported_fx2[j].usb_manufacturer)) &&
- (!supported_fx2[j].usb_manufacturer ||
+ (!supported_fx2[j].usb_product ||
!strcmp(product, supported_fx2[j].usb_product))) {
prof = &supported_fx2[j];
break;
sdi->vendor = g_strdup(prof->vendor);
sdi->model = g_strdup(prof->model);
sdi->version = g_strdup(prof->model_version);
- sdi->driver = di;
sdi->serial_num = g_strdup(serial_num);
sdi->connection_id = g_strdup(connection_id);
devc = fx2lafw_dev_new();
devc->profile = prof;
- if ((prof->dev_caps & DEV_CAPS_16BIT) || (prof->dev_caps & DEV_CAPS_AX_ANALOG))
- devc->sample_wide = TRUE;
sdi->priv = devc;
- drvc->instances = g_slist_append(drvc->instances, sdi);
devices = g_slist_append(devices, sdi);
if (!strcmp(prof->model, "DSLogic")
libusb_free_device_list(devlist, 1);
g_slist_free_full(conn_devices, (GDestroyNotify)sr_usb_dev_inst_free);
- return devices;
+ return std_scan_complete(di, devices);
}
static void clear_dev_context(void *priv)
else
devc->send_data_proc = la_send_data_proc;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
return SR_OK;
}
if (transfer->status == LIBUSB_TRANSFER_CANCELLED) {
sr_dbg("Trigger transfer canceled.");
/* Terminate session. */
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
usb_source_remove(sdi->session, devc->ctx);
devc->num_transfers = 0;
g_free(devc->transfers);
const GSList *l;
int p;
struct sr_channel *ch;
+ uint32_t channel_mask = 0, num_analog = 0;
devc = sdi->priv;
for (l = sdi->channels, p = 0; l; l = l->next, p++) {
ch = l->data;
if ((p <= NUM_CHANNELS) && (ch->type == SR_CHANNEL_ANALOG)) {
+ num_analog++;
devc->ch_enabled[p] = ch->enabled;
devc->enabled_analog_channels =
g_slist_append(devc->enabled_analog_channels, ch);
+ } else {
+ channel_mask |= ch->enabled << p;
}
}
+ /* Use no wide sampling if we have only the first 8 channels set. */
+ devc->sample_wide = (channel_mask > 0xff || num_analog > 0);
+
return SR_OK;
}