disabled tos mode for serial output (appears to be broken) + log

messages with only printable characters
This commit is contained in:
Fredrik Osterlind 2011-02-11 15:44:23 +01:00
parent eab795c14c
commit 6cb60b3a34

View file

@ -322,10 +322,12 @@ public abstract class SerialUI extends Log implements SerialPort {
} else { } else {
if (data == 0x7e) { if (data == 0x7e) {
tosChars++; tosChars++;
totalTOSChars = 0; /* XXX Disabled TOS mode due to error */
totalTOSChars++; totalTOSChars++;
if (tosChars == 2) { if (tosChars == 2) {
if (totalTOSChars > slipCounter) { if (totalTOSChars > slipCounter) {
tosMode = true; tosMode = true;
tosMode = false; /* XXX Disabled TOS mode due to error */
/* already read one char here */ /* already read one char here */
tosPos = 1; tosPos = 1;
} else { } else {
@ -337,6 +339,7 @@ public abstract class SerialUI extends Log implements SerialPort {
} }
if (data == '\n') { if (data == '\n') {
lastLogMessage = newMessage.toString(); lastLogMessage = newMessage.toString();
lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}]", "");
newMessage.setLength(0); newMessage.setLength(0);
this.setChanged(); this.setChanged();
this.notifyObservers(getMote()); this.notifyObservers(getMote());