Skip to content

Commit

Permalink
only show printable characters in mote output plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
fros4943 committed Aug 15, 2013
1 parent e5fe373 commit 871ea38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/cooja/java/se/sics/cooja/dialogs/SerialUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public void dataReceived(int data) {
newMessage.append((char) data);
if (newMessage.length() > MAX_LENGTH) {
/*logger.warn("Dropping too large log message (>" + MAX_LENGTH + " bytes).");*/
lastLogMessage = "# [1024 bytes binary data]";
lastLogMessage = "# [1024 bytes, no line ending]: " + newMessage.substring(0, 20) + "...";
lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}]", "");
newMessage.setLength(0);
this.setChanged();
this.notifyObservers(getMote());
Expand Down

0 comments on commit 871ea38

Please sign in to comment.