aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java9
1 files changed, 7 insertions, 2 deletions
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()) {