How to read string input from Android on USB
I am trying to connect PIC32MZ (device) with Android (host) using USB CDC. I am unable to read multi-character command sent from Android.
In the demonstrations for system console and system command services, the device works fine when using with tera term on a Windows machine because every command is sent as a single character as soon as it is typed into the console. But when I am sending a string command (for e.g. abcdefgh) from android, device only reads the first character of the command ('a' in this example).
I have tried configuring following settings, but did not help:
- Removed system command service.
- Reading USB CDC data using SYS_CONSOLE_Read() function with number of bytes to be read as 10 in polling or non-blocking implementation.
- Increased the CDC read queue size and console read USB buffer queue size to 10. With these settings, SYS_CONSOLE_Read() returns after reading the first character of 10 sequential string commands send from Android.
I am using Harmony v2.06
Any pointers from someone who is able to interface USB CDC with Android is welcome.