diff options
Diffstat (limited to 'src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java b/src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java index 0d3995144..dc169c668 100644 --- a/src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacSFKamelProtocolDecoder.java @@ -118,8 +118,9 @@ public class LaipacSFKamelProtocolDecoder extends BaseProtocolDecoder { checksum = parser.next(); } + String result = sentence.replaceAll("^\\$(.*)\\*[0-9a-fA-F]{2}$", "$1"); - if (Integer.parseInt(checksum, 16) != Checksum.xor(result)) + if (checksum == null || Integer.parseInt(checksum, 16) != Checksum.xor(result)) { return null; } |