diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-08-25 10:35:10 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-08-25 10:35:22 +1200 |
commit | 74519eebedc75fec380005a2a1e6300ddd803ceb (patch) | |
tree | 55b0ea7551dcbbb1a9f53a96bba3d881860c3eac /src/org/traccar/protocol | |
parent | 052d5a61dbb7a94d4ac2ea4f17deff0f99baec58 (diff) | |
download | trackermap-server-74519eebedc75fec380005a2a1e6300ddd803ceb.tar.gz trackermap-server-74519eebedc75fec380005a2a1e6300ddd803ceb.tar.bz2 trackermap-server-74519eebedc75fec380005a2a1e6300ddd803ceb.zip |
Decode Aplicom event data as HEX
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/AplicomProtocolDecoder.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index f530c8fa5..bfd92e0ad 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -103,16 +103,8 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); break; case 119: - StringBuilder sb = new StringBuilder(); - while (buf.isReadable()) { - char c = (char) buf.readByte(); - if (c >= 0x20) { - sb.append(c); - } else { - break; - } - } - position.set("eventData", sb.toString()); + position.set("eventData", ByteBufUtil.hexDump( + buf, buf.readerIndex(), Math.min(buf.readableBytes(), 1024))); break; case 121: case 142: |