Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the listDevices always null #2

Closed
zxj17815 opened this issue Mar 5, 2019 · 8 comments
Closed

the listDevices always null #2

zxj17815 opened this issue Mar 5, 2019 · 8 comments

Comments

@zxj17815
Copy link

zxj17815 commented Mar 5, 2019

I simulation usb COM1(android) and usb COM2,but the listDevices always null,when I click send,
error:

E/flutter ( 2498): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception: E/flutter ( 2498): NoSuchMethodError: The method 'write' was called on null. E/flutter ( 2498): Receiver: null E/flutter ( 2498): Tried calling: write(Uint8Array) E/flutter ( 2498): #0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5) E/flutter ( 2498): #1 _MyAppState.build.<anonymous closure> package:usb/main.dart:71 E/flutter ( 2498): <asynchronous suspension> E/flutter ( 2498): #2 _InkResponseState._handleTap package:flutter/…/material/ink_well.dart:507

@altera2015
Copy link
Owner

I'm guessing your solution is not simulating a USB CDC (or similar) device but directly a COM port in the Linux kernel. This code base is intended to access UART hardware connected via USB.
Can you give me more details on how you simulated your comports? What hardware vendor and product ids?

Thanks

@zxj17815
Copy link
Author

I can connect now, but the problem is that I did not receive the returned information after sending, I do not know whether the instruction sent in the past does not belong to hex? Because I can receive the return message when I test with another software

@zxj17815
Copy link
Author

I find the pid=24577&vid=1027,it doesn't work;
and I use the other pid=8963&vid=1659, it work.

@zxj17815
Copy link
Author

oh,but I tested by FTDIs'app ,it's working, I have no idea...

@zxj17815
Copy link
Author

Is it a driver problem? But open is ok, when I send the data, the receiving light on the control panel flashes, does it mean that the hardware and driver are ok, just my code has problems.

@altera2015
Copy link
Owner

I'm not sure, can you link your code?

@altera2015
Copy link
Owner

I've updated to the latest UsbSerial underlying library. Give it a go with 0.2.1, it might solve your trouble.

@zxj17815
Copy link
Author

Thank you, it work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants