From bba38f9078a1c1455730daf80d76587cf21228cc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 17 Jul 2019 08:14:43 -0700 Subject: Fix event decoding --- src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java index 8164a016d..c4b29850d 100644 --- a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java @@ -184,8 +184,8 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { for (; index < fragments.length; index += 1) { if (!fragments[index].isEmpty()) { - if (Character.isDigit(fragments[index].charAt(0))) { - position.set(Position.KEY_EVENT, Integer.parseInt(fragments[index])); + if (fragments[index].matches("\\p{XDigit}+")) { + position.set(Position.KEY_EVENT, Integer.parseInt(fragments[index], 16)); } else { decodeFragment(position, fragments[index]); } -- cgit v1.2.3