Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
351
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None
  1. while(ready)
  2. {
  3.  
  4. try
  5. {
  6. Thread.sleep(100);
  7. System.out.println("response " + response);
  8. while(inStream.available() > 0)
  9. {
  10. int ch;
  11. ch = inStream.read();
  12. response = response + (char)ch;
  13. if(ch == 3)
  14. {
  15. String managerResponse = serialCommandManager.doCommand(response.substring(0, response.length()));
  16. if(managerResponse != null)
  17. {
  18. send(managerResponse);
  19. }
  20. response = "";
  21. //end of transmision, isue serial command
  22. }
  23. }
  24. } catch (Exception ex) {
  25. response = "";
  26. debugLogger.printSystemOut("Exception on RS232 income " + ex);
  27. }
  28. }
Advertisement
RAW Paste Data Copied
Advertisement