aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/helper
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-12 07:27:40 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-12 07:27:48 -0700
commit7325030436e5fc42b6998240a0c5696a1d4fed5a (patch)
tree70bcbe4fb90b3c19857b606fae23310e20aead52 /src/main/java/org/traccar/helper
parentb3c6e22fc19ceeceb0f318131538b5e1d260450c (diff)
downloadtrackermap-server-7325030436e5fc42b6998240a0c5696a1d4fed5a.tar.gz
trackermap-server-7325030436e5fc42b6998240a0c5696a1d4fed5a.tar.bz2
trackermap-server-7325030436e5fc42b6998240a0c5696a1d4fed5a.zip
Fix GT06 transparent data
Diffstat (limited to 'src/main/java/org/traccar/helper')
-rw-r--r--src/main/java/org/traccar/helper/BufferUtil.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/helper/BufferUtil.java b/src/main/java/org/traccar/helper/BufferUtil.java
index d1025f548..12c31ba9d 100644
--- a/src/main/java/org/traccar/helper/BufferUtil.java
+++ b/src/main/java/org/traccar/helper/BufferUtil.java
@@ -71,4 +71,16 @@ public final class BufferUtil {
}
}
+ public static boolean isPrintable(ByteBuf buf, int length) {
+ boolean printable = true;
+ for (int i = 0; i < length; i++) {
+ byte b = buf.getByte(buf.readerIndex() + i);
+ if (b < 32 && b != '\r' && b != '\n') {
+ printable = false;
+ break;
+ }
+ }
+ return printable;
+ }
+
}