Guest User

Untitled

a guest
Jan 12th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. $
  2. G
  3. P
  4. G
  5. G
  6. A
  7. ,
  8. .
  9. .
  10. .
  11. (Carriage return)
  12. (New Line)
  13. $
  14. G
  15. P
  16. G
  17. S
  18. A
  19.  
  20. static class SerialPortReader implements SerialPortEventListener {
  21.  
  22. public void serialEvent(SerialPortEvent event) {
  23.  
  24.  
  25. try {
  26. byte[] tester = serialPort.readBytes(1);
  27.  
  28. //System.out.print(getdata);
  29. InputStream gpsStream = new ByteArrayInputStream(tester);
  30.  
  31. BufferedReader in = new BufferedReader(new InputStreamReader(gpsStream, StandardCharsets.UTF_8));
  32. String output = in.readLine();
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. }
  40.  
  41.  
  42. catch (SerialPortException | IOException ex) {
  43. }
  44. }
Add Comment
Please, Sign In to add comment