mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-09-10 01:17:51 +00:00
Updated Troubleshooting (mediawiki)
parent
7c5f6151d3
commit
6b569abce1
@ -46,7 +46,7 @@ For example, to receive a 100 byte string, you might read 64 bytes, then 36 byte
|
|||||||
* Newline-terminated messages: Read until you see a <code>\n</code> (or any other "terminal" character).
|
* Newline-terminated messages: Read until you see a <code>\n</code> (or any other "terminal" character).
|
||||||
|
|
||||||
|
|
||||||
== I observed <code>read</code> ''data loss'' with continuous transfer at high baud rates ==
|
== I observed <code>read</code> data loss with continuous transfer at high baud rates ==
|
||||||
|
|
||||||
Android is not a real time OS. The thread responsible for receiving data might not be scheduled by the OS or garbage collection might be ongoing or …
|
Android is not a real time OS. The thread responsible for receiving data might not be scheduled by the OS or garbage collection might be ongoing or …
|
||||||
Therefore data loss can happen for continues read at high baud rates. If data is lost, typically some smaller fragments in the middle of the data are missing.
|
Therefore data loss can happen for continues read at high baud rates. If data is lost, typically some smaller fragments in the middle of the data are missing.
|
||||||
@ -55,7 +55,7 @@ This effect is more likely for slower Android device and USB devices with smalle
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
''Data loss'' can also occur with inappropriate buffer size, as shown in next Question.
|
Data loss can also occur with inappropriate buffer size, as shown in next Question.
|
||||||
|
|
||||||
|
|
||||||
== How to size the <code>read</code> buffer? ==
|
== How to size the <code>read</code> buffer? ==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user