1
0
mirror of https://github.com/mik3y/usb-serial-for-android.git synced 2026-08-11 16:32:53 +00:00

useReadQueue

kai-morich
2025-12-05 18:44:25 +01:00
parent 71528fc0df
commit 201c7e7a38
+5 -1
@@ -120,7 +120,11 @@ Therefore data loss can happen for continues read at high baud rates. If data is
This effect is more likely for slower Android device and USB devices with smaller buffer size and typically starts with higher baud rates like 115k2 baud, but is hardly predictable. For low baud rates or non-continuous transfers this issue was not observed as the USB device will not run into a read buffer overflow before the next USB read transfer.
Using a higher thread priority (default for <code>SerialInputOutputManager</code> since ''usb-serial-for-android v3.1.0'') and offloading work from <code>onNewData</code> to other threads can mitigates the issue.
To mitigate the issue, you can
* use a higher thread priority (default for <code>SerialInputOutputManager</code> since ''usb-serial-for-android v3.1.0''),
* offload work from <code>onNewData</code> to other threads,
* batch process data, e.g. instead of showing each data fragment individually on a UI,
* use <code>setReadQueue</code>.
It is recommended to use some sort of flow control like X-Modem protocol.