X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fsaleae-logic16%2Fapi.c;h=99916e44e1343cbfedaffc961dba3250178b80bc;hb=a0ade2f933d62fee3dea55475c7a9c69883b8b25;hp=dedb9a244a2c637e59766125d2bfd801662314f2;hpb=21fe5dba36bd388ed271b78b80df980ab13a63fd;p=libsigrok.git diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index dedb9a24..99916e44 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -188,7 +188,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) libusb_get_device_descriptor(devlist[i], &des); - usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); + if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0) + continue; if (des.idVendor != LOGIC16_VID || des.idProduct != LOGIC16_PID) continue; @@ -218,11 +219,12 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) libusb_get_device_address(devlist[i]), NULL); } else { if (ezusb_upload_firmware(drvc->sr_ctx, devlist[i], - USB_CONFIGURATION, FX2_FIRMWARE) == SR_OK) + USB_CONFIGURATION, FX2_FIRMWARE) == SR_OK) { /* Store when this device's FW was updated. */ devc->fw_updated = g_get_monotonic_time(); - else - sr_err("Firmware upload failed."); + } else { + sr_err("Firmware upload failed, name %s.", FX2_FIRMWARE); + } sdi->inst_type = SR_INST_USB; sdi->conn = sr_usb_dev_inst_new( libusb_get_bus_number(devlist[i]), 0xff, NULL); @@ -266,7 +268,9 @@ static int logic16_dev_open(struct sr_dev_inst *sdi) /* * Check device by its physical USB bus/port address. */ - usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); + if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0) + continue; + if (strcmp(sdi->connection_id, connection_id)) /* This is not the one. */ continue;