usb-serial-for-android icon indicating copy to clipboard operation
usb-serial-for-android copied to clipboard

Continous data bottleneck location

Open FrancoHMJP opened this issue 1 year ago • 1 comments

Hi, We are currently using the library as a plugin for a Unity app.

Unity script refresh rate is 30Hz so we are polling port.read() every ~30mS. Device is sending continous data at 9600 baud but we are loosing packets.

  1. Is there any "interrupt driven" usage of the library in order to buffer incoming data?
  2. Is this a common/know limitation of Android USB API? If so, whats the procedure to handle this?

Lastly, we are in doutb why the "protocol header" is 2 bytes?. We always seem to have 2 bytes more thant the returned by port.read(). ie: device sends 0x01-0x02-0x03-0x04, port.read() returns 2.

FrancoHMJP avatar Jan 17 '23 02:01 FrancoHMJP