• AVR Freaks

Hot!How to read string input from Android on USB

New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2012/09/18 09:29:29
  • Location: 0
  • Status: offline
2020/09/27 12:27:35 (permalink)

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.
Jump to:
© 2020 APG vNext Commercial Version 4.5