mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Merge pull request #469 from eberlin/cooja-tab-char
Fix: preserving blank characters (tabulator and space) in Cooja serial output
This commit is contained in:
commit
c99a76747c
@ -102,7 +102,7 @@ public abstract class SerialUI extends Log implements SerialPort {
|
|||||||
if (data == '\n') {
|
if (data == '\n') {
|
||||||
/* Notify observers of new log */
|
/* Notify observers of new log */
|
||||||
lastLogMessage = newMessage.toString();
|
lastLogMessage = newMessage.toString();
|
||||||
lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}]", "");
|
lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}\\p{Blank}]", "");
|
||||||
newMessage.setLength(0);
|
newMessage.setLength(0);
|
||||||
this.setChanged();
|
this.setChanged();
|
||||||
this.notifyObservers(getMote());
|
this.notifyObservers(getMote());
|
||||||
@ -111,7 +111,7 @@ public abstract class SerialUI extends Log implements SerialPort {
|
|||||||
if (newMessage.length() > MAX_LENGTH) {
|
if (newMessage.length() > MAX_LENGTH) {
|
||||||
/*logger.warn("Dropping too large log message (>" + MAX_LENGTH + " bytes).");*/
|
/*logger.warn("Dropping too large log message (>" + MAX_LENGTH + " bytes).");*/
|
||||||
lastLogMessage = "# [1024 bytes, no line ending]: " + newMessage.substring(0, 20) + "...";
|
lastLogMessage = "# [1024 bytes, no line ending]: " + newMessage.substring(0, 20) + "...";
|
||||||
lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}]", "");
|
lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}\\p{Blank}]", "");
|
||||||
newMessage.setLength(0);
|
newMessage.setLength(0);
|
||||||
this.setChanged();
|
this.setChanged();
|
||||||
this.notifyObservers(getMote());
|
this.notifyObservers(getMote());
|
||||||
|
Loading…
Reference in New Issue
Block a user