quick_usb
quick_usb copied to clipboard
How to keep reading data constantly?
In my case, data is inputted erratically through the serial port to my android device, thus the bulkTransferIn function doesn't really suite my purpose. Plugins like usb_serial let you specify a function to be run whenever the android device receives any data through the serial device. Should I run the bulkTransferIn function on a loop or is there a better way to achieve my purpose using this plugin?
I'm not sure about the API, could you post an example?
I was looking for something like an event, I've tried the usb_serial package and it's port object has an event that triggers a function whenever it listens to data.
port.inputStream.listen((Uint8List event) {
print(event);
port.close();
});
That would be a big feature request. I'm not sure I have enough time for cross-platform implementation.
PRs welcome
Ah sure, just needed to know if there was an existing implementation for the same.
I'd like to leave it open for future implementation