From dd7d1c19d3f8e50f79a057af0e2aee70165ac82f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 31 Oct 2021 17:06:40 -0700 Subject: Handle SP4600 command responses --- src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java index 76278070e..a86249224 100644 --- a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2019 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2021 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -187,7 +187,12 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { int index = 0; String[] fragments = sentence.split(","); - position.setTime(new SimpleDateFormat("HHmmssddMMyy").parse(fragments[index++])); + if (fragments[index].matches("[0-9]{12}")) { + position.setTime(new SimpleDateFormat("HHmmssddMMyy").parse(fragments[index++])); + } else { + getLastLocation(position, null); + position.set(Position.KEY_RESULT, fragments[index++]); + } for (; index < fragments.length; index += 1) { if (!fragments[index].isEmpty()) { -- cgit v1.2.3