aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/GoSafeProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/GoSafeProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/GoSafeProtocolDecoder.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java
index 96f745917..51479ad52 100644
--- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java
+++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java
@@ -43,8 +43,8 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
.text("*GS") // header
.number("d+,") // protocol version
.number("(d+),") // imei
- .number("(dd)(dd)(dd)") // time
- .number("(dd)(dd)(dd),") // date
+ .number("(dd)(dd)(dd)") // time (hhmmss)
+ .number("(dd)(dd)(dd),") // date (ddmmyy)
.expression("(.*)#?") // data
.compile();
@@ -121,7 +121,7 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
.number("d+,") // protocol version
.number("(d+),") // imei
.text("GPS:")
- .number("(dd)(dd)(dd);") // time
+ .number("(dd)(dd)(dd);") // time (hhmmss)
.number("d;").optional() // fix type
.expression("([AV]);") // validity
.number("([NS])(d+.d+);") // latitude
@@ -129,7 +129,7 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
.number("(d+)?;") // speed
.number("(d+);") // course
.number("(d+.?d*)").optional() // hdop
- .number("(dd)(dd)(dd)") // date
+ .number("(dd)(dd)(dd)") // date (ddmmyy)
.any()
.compile();
@@ -242,10 +242,7 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
Date time = null;
if (parser.hasNext(6)) {
- DateBuilder dateBuilder = new DateBuilder()
- .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt())
- .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt());
- time = dateBuilder.getDate();
+ time = parser.nextDateTime(Parser.DateTimeFormat.HMS_DMY);
}
List<Position> positions = new LinkedList<>();