aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/HaicomProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/HaicomProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/HaicomProtocolDecoder.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java
index db26db820..dc8121ed3 100644
--- a/src/org/traccar/protocol/HaicomProtocolDecoder.java
+++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java
@@ -19,7 +19,6 @@ import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.BitUtil;
-import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.model.Position;
@@ -37,8 +36,8 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder {
.text("$GPRS")
.number("(d+),") // imei
.expression("([^,]+),") // version
- .number("(dd)(dd)(dd),") // date
- .number("(dd)(dd)(dd),") // time
+ .number("(dd)(dd)(dd),") // date (yymmdd)
+ .number("(dd)(dd)(dd),") // time (hhmmss)
.number("(d)") // flags
.number("(dd)(d{5})") // latitude
.number("(ddd)(d{5}),") // longitude
@@ -74,10 +73,7 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_VERSION_FW, parser.next());
- DateBuilder dateBuilder = new DateBuilder()
- .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt())
- .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt());
- position.setTime(dateBuilder.getDate());
+ position.setTime(parser.nextDateTime(Parser.DateTimeFormat.Y2MD_HMS));
int flags = parser.nextInt();