woodemi / quick_usb

A cross-platform (Android/Windows/macOS/Linux) USB plugin for Flutter
BSD 3-Clause "New" or "Revised" License
43 stars 30 forks source link

not working on windows #54

Closed bikram0000 closed 2 years ago

bikram0000 commented 2 years ago

I can get the device list but am not able to open the device, always return false Screenshot 2022-03-09 113222 Screenshot 2022-03-09 113240 .

Sunbreak commented 2 years ago

Could you try https://github.com/woodemi/libusb.dart?

How is the open result?

bikram0000 commented 2 years ago

F:\ANDROID\Git Project Plugin\libusb.dart>pub run ffigen "The top level pub.bat command is deprecated. Use dart pub instead." Running in Directory: 'F:\ANDROID\Git Project Plugin\libusb.dart' Input Headers: [libusb-1.0\libusb.h] [WARNING]: Skipped Function 'libusb_cpu_to_le16', inline functions are not supported. [WARNING]: Removed All Struct Members from libusb_bos_dev_capability_descriptor(libusb_bos_dev_capability_descriptor), Flexible array members not s upported. [WARNING]: Removed All Struct Members from libusb_bos_descriptor(libusb_bos_descriptor), Flexible array members not supported. [WARNING]: Removed All Struct Members from libusb_transfer(libusb_transfer), Flexible array members not supported. [WARNING]: Skipped Function 'libusb_control_transfer_get_data', inline functions are not supported. [WARNING]: Skipped Function 'libusb_control_transfer_get_setup', inline functions are not supported. [WARNING]: Skipped Function 'libusb_fill_control_setup', inline functions are not supported. [WARNING]: Skipped Function 'libusb_fill_control_transfer', inline functions are not supported. [WARNING]: Skipped Function 'libusb_fill_bulk_transfer', inline functions are not supported. [WARNING]: Skipped Function 'libusb_fill_bulk_stream_transfer', inline functions are not supported. [WARNING]: Skipped Function 'libusb_fill_interrupt_transfer', inline functions are not supported. [WARNING]: Skipped Function 'libusb_fill_iso_transfer', inline functions are not supported. [WARNING]: Skipped Function 'libusb_set_iso_packet_lengths', inline functions are not supported. [WARNING]: Skipped Function 'libusb_get_iso_packet_buffer', inline functions are not supported. [WARNING]: Skipped Function 'libusb_get_iso_packet_buffer_simple', inline functions are not supported. [WARNING]: Skipped Function 'libusb_get_descriptor', inline functions are not supported. [WARNING]: Skipped Function 'libusb_get_string_descriptor', inline functions are not supported. Finished, Bindings generated in F:\ANDROID\Git Project Plugin\libusb.dart\lib\src\libusb.ffigen.dart

Sunbreak commented 2 years ago

Could you try something like pub run example/listdevs.dart, not ffigen

You could change the code inside listdevs.dart to open the device you list

bikram0000 commented 2 years ago

Building package executable... Built libusb:listDeviceProducts. 1165:49408 open error: LIBUSB_ERROR_NO_DEVICE 1226:28784 open error: LIBUSB_ERROR_NOT_FOUND 4070:33054 open error: LIBUSB_ERROR_NOT_SUPPORTED 32902:41837 iProduct empty 32903:2730 iProduct empty deviceProductInfo [MapEntry(1165:49408: ), MapEntry(1226:28784: ), MapEntry(4070:33054: ), MapEntry(32902:41837: ), MapEntry(32903:2730: )]

4070 is a thermal printer and it perfectly working with macOS but not open in windows

Sunbreak commented 2 years ago

LIBUSB_ERROR_NOT_SUPPORTED seems you haven't installed the right driver

bikram0000 commented 2 years ago

thank you for your help I installed zadig and reinstall the driver, my problem is solved now.

kalimero-plt commented 2 years ago

I also have the same problem. I ran listdevs.dart. It lists the devices. But still openDevice returns false.

Sunbreak commented 2 years ago

I also have the same problem. I ran listdevs.dart. It lists the devices. But still openDevice returns false.

What about listDeviceProducts.dart beside listdevs.dart?

kalimero-plt commented 2 years ago

Thank you for your reply. I tried what you said. It gave the error LIBUSB_ERROR_NOT_SUPPORTED. I installed Zadig and reinstall the driver. OpenDevice returned true. Problem solved.