aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MeitrackProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/MeitrackProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MeitrackProtocolDecoder.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
index a4a0d2d42..bd6f3e8be 100644
--- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
@@ -20,7 +20,6 @@ import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.Context;
import org.traccar.DeviceSession;
-import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
@@ -50,8 +49,8 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // event
.number("(-?d+.d+),") // latitude
.number("(-?d+.d+),") // longitude
- .number("(dd)(dd)(dd)") // date (ddmmyy)
- .number("(dd)(dd)(dd),") // time
+ .number("(dd)(dd)(dd)") // date (yymmdd)
+ .number("(dd)(dd)(dd),") // time (hhmmss)
.number("([AV]),") // validity
.number("(d+),") // satellites
.number("(d+),") // rssi
@@ -107,10 +106,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
position.setLatitude(parser.nextDouble());
position.setLongitude(parser.nextDouble());
- 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());
position.setValid(parser.next().equals("A"));