From 74519eebedc75fec380005a2a1e6300ddd803ceb Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 25 Aug 2018 10:35:10 +1200 Subject: Decode Aplicom event data as HEX --- src/org/traccar/protocol/AplicomProtocolDecoder.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/org/traccar/protocol') 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: -- cgit v1.2.3