Add missing readStringUntil() method

This commit is contained in:
gohai
2013-10-28 17:18:13 +01:00
parent 4f186536bf
commit 72ec72ae53

View File

@@ -349,6 +349,16 @@ public class Serial implements SerialPortEventListener {
}
public String readStringUntil(int inByte) {
byte temp[] = readBytesUntil(inByte);
if (temp == null) {
return null;
} else {
return new String(temp);
}
}
public void serialEvent(SerialPortEvent event) {
if (event.getEventType() == SerialPortEvent.RXCHAR) {
int toRead;