2

Library: https://github.com/felHR85/UsbSerial

I'm new to android development, so for all I know the answer to my question may be staring me directly in the face.

When I post a command I do not receive any feedback from the device I'm sending the command to (light fixture controller). However, when I load up Serial USB Terminal (Android app) and send a random (even invalid) command, it'll take care of the command I sent with UsbSerial first and validating that it went through (responds with "OK"). Which leads me to believe the command is stuck in a buffer somewhere. I'm building the application using API 19 because the devices we are using do not update beyond Kit Kat, not sure if that makes a difference.

Any ideas?

Any ideas or help would be GREATLY appreciated. Been trying to work through this problem for a week now.

ltd9938
  • 1,444
  • 1
  • 15
  • 29

1 Answers1

1

God I'm an idiot. I didn't add a newline after every command sent. Hopefully this will help someone like me down the road!

For example I do

String cmd = "sfd\n";
usbService.write(cmd.getBytes());
ltd9938
  • 1,444
  • 1
  • 15
  • 29
  • I'm an idiot too. Can you post the code for writing new line? did you just pass "\n".getBytes() to .write() on the UsbSerializer? – Dap Jul 10 '18 at 20:28
  • In my main activity I do `String cmd = "sfd\n";` Then do `usbService.write(cmd.getBytes());` – ltd9938 Jul 10 '18 at 20:31