aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/OkoProtocolDecoder.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/OkoProtocolDecoder.java b/src/org/traccar/protocol/OkoProtocolDecoder.java
index 312127283..e86acf0b8 100644
--- a/src/org/traccar/protocol/OkoProtocolDecoder.java
+++ b/src/org/traccar/protocol/OkoProtocolDecoder.java
@@ -35,14 +35,14 @@ public class OkoProtocolDecoder extends BaseProtocolDecoder {
private static final Pattern PATTERN = new PatternBuilder()
.text("{")
.number("(d{15}),").optional() // imei
- .number("(dd)(dd)(dd).(ddd),") // time
+ .number("(dd)(dd)(dd).d+,") // time
.expression("([AV]),") // validity
.number("(dd)(dd.d+),") // latitude
.expression("([NS]),")
.number("(ddd)(dd.d+),") // longitude
.expression("([EW]),")
- .number("(d+.?d*),") // speed
- .number("(d+.?d*),") // course
+ .number("(d+.?d*)?,") // speed
+ .number("(d+.?d*)?,") // course
.number("(dd)(dd)(dd),") // date (ddmmyy)
.number("(d+),") // satellites
.number("(d+.d+),") // adc
@@ -77,13 +77,13 @@ public class OkoProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(deviceSession.getDeviceId());
DateBuilder dateBuilder = new DateBuilder()
- .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt());
+ .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt());
position.setValid(parser.next().equals("A"));
position.setLatitude(parser.nextCoordinate());
position.setLongitude(parser.nextCoordinate());
- position.setSpeed(parser.nextDouble());
- position.setCourse(parser.nextDouble());
+ position.setSpeed(parser.nextDouble(0));
+ position.setCourse(parser.nextDouble(0));
dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt());
position.setTime(dateBuilder.getDate());