forked from Ivasoft/DSView
Termux-usb hack finalized
This commit is contained in:
@@ -379,4 +379,8 @@ int libusb_open_termux(libusb_device *dev, libusb_device_handle **dev_handle) {
|
||||
return LIBUSB_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
void libusb_close_termux(libusb_device_handle *dev_handle) {
|
||||
// do nothing we have a singleton device instance
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
@@ -294,7 +294,7 @@ SR_PRIV gboolean dsl_check_conf_profile(libusb_device *dev)
|
||||
}
|
||||
|
||||
if (hdl){
|
||||
libusb_close(hdl);
|
||||
libusb_close_termux(hdl);
|
||||
}
|
||||
|
||||
return bSucess;
|
||||
@@ -1994,7 +1994,7 @@ SR_PRIV int dsl_dev_close(struct sr_dev_inst *sdi)
|
||||
|
||||
if (usb->devhdl != NULL){
|
||||
libusb_release_interface(usb->devhdl, USB_INTERFACE);
|
||||
libusb_close(usb->devhdl);
|
||||
libusb_close_termux(usb->devhdl);
|
||||
}
|
||||
//sr_info("------------Close the libusb_device_handle:%p, struct:%p", usb->devhdl, usb);
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ SR_PRIV int ezusb_upload_firmware(libusb_device *dev, int configuration,
|
||||
return SR_ERR;
|
||||
|
||||
if (hdl != NULL)
|
||||
libusb_close(hdl);
|
||||
libusb_close_termux(hdl);
|
||||
|
||||
return SR_OK;
|
||||
}
|
||||
|
||||
@@ -280,6 +280,7 @@ SR_PRIV void sr_usb_dev_inst_free(struct sr_usb_dev_inst *usb);
|
||||
ssize_t libusb_get_device_list_termux(libusb_context *ctx, libusb_device ***list);
|
||||
void libusb_free_device_list_termux(libusb_device **list, int unref_devices);
|
||||
int libusb_open_termux(libusb_device *dev, libusb_device_handle **dev_handle);
|
||||
void libusb_close_termux(libusb_device_handle *dev_handle);
|
||||
|
||||
/* Serial-specific instances */
|
||||
SR_PRIV struct sr_serial_dev_inst *sr_serial_dev_inst_new(const char *port,
|
||||
|
||||
Reference in New Issue
Block a user