altera2015 / usbserial

Flutter Android USB Serial plugin
BSD 3-Clause "New" or "Revised" License
121 stars 83 forks source link

Communication with always streaming device #64

Closed pattystars closed 2 years ago

pattystars commented 2 years ago

Hello,

Thank you for the great package. I am having issues obtaining a data stream.

I am attempting to communicate with a device that is always streaming 01 and 60 once the serial connection is established. The screen shot below is of the raw data view of a usb sniffer. The data needed is only returned once A\r is sent to the device [41 0d].

I am wondering what method of this package would be best to pull the desired data out of the following stream?

Captureas

I have tried several methods of obtaining a stream and keep receiving null or Instance of '_ControllerStream'. I am not sure if it is a matter of converting the data to something that the device can receive and read or if the data returned is not readable or nothing is being sent back at all.

Many thanks to anyone with suggestions

pattystars commented 2 years ago

_transaction = Transaction.stringTerminated( _port!.inputStream as Stream<Uint8List>, Uint8List.fromList([13]));

This resolved my issue!