return 0;
}
+libusb_device * LIBUSB_CALL libusb_get_device_with_fd(libusb_context *ctx,
+ int vid, int pid, const char *serial, int fd, int busnum, int devaddr) {
+ usbi_dbg("libusb_get_device_with_fd, fd:%d, serial:%s", fd, serial);
+
+ struct libusb_device *device = NULL;
+ // android_generate_device内でusbi_alloc_deviceが呼ばれた時に参照カウンタは1
+ int ret = linux_generate_device(ctx, &device, vid, pid, serial, fd, busnum, devaddr);
+ if (ret) {
+ usbi_err(ctx, "libusb_get_device_with_fd");
+ device = NULL;
+ }
+ return device;
+}
+
+
/** \ingroup libusb_dev
* Open a device and obtain a device handle. A handle allows you to perform
* I/O on the device in question.
size_t priv_size = usbi_backend.device_handle_priv_size;
int r;
usbi_dbg("open %d.%d", dev->bus_number, dev->device_address);
+ __android_log_write(ANDROID_LOG_ERROR, "libusb", "haha");
if (!dev->attached) {
return LIBUSB_ERROR_NO_DEVICE;