|
|
|
@ -72,12 +72,23 @@ accept_device(libusb_device *device, const char *serial,
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
sc_usb_device_destroy(struct sc_usb_device *usb_device) {
|
|
|
|
sc_usb_device_destroy(struct sc_usb_device *usb_device) {
|
|
|
|
|
|
|
|
if (usb_device->device) {
|
|
|
|
libusb_unref_device(usb_device->device);
|
|
|
|
libusb_unref_device(usb_device->device);
|
|
|
|
|
|
|
|
}
|
|
|
|
free(usb_device->serial);
|
|
|
|
free(usb_device->serial);
|
|
|
|
free(usb_device->manufacturer);
|
|
|
|
free(usb_device->manufacturer);
|
|
|
|
free(usb_device->product);
|
|
|
|
free(usb_device->product);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
sc_usb_device_move(struct sc_usb_device *dst, struct sc_usb_device *src) {
|
|
|
|
|
|
|
|
*dst = *src;
|
|
|
|
|
|
|
|
src->device = NULL;
|
|
|
|
|
|
|
|
src->serial = NULL;
|
|
|
|
|
|
|
|
src->manufacturer = NULL;
|
|
|
|
|
|
|
|
src->product = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
sc_usb_devices_destroy_all(struct sc_usb_device *usb_devices, size_t count) {
|
|
|
|
sc_usb_devices_destroy_all(struct sc_usb_device *usb_devices, size_t count) {
|
|
|
|
for (size_t i = 0; i < count; ++i) {
|
|
|
|
for (size_t i = 0; i < count; ++i) {
|
|
|
|
|