aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-17 17:31:38 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-10-17 17:31:38 -0700
commitb5cfcc219cc9ab4c37077c4901f6e559e1519b13 (patch)
tree1d05612733d7146533adcfed50a369c6c910a11e /src/main/java/org/traccar
parente0f48dc8d4530a617ac7e338c9768ca48217869c (diff)
downloadtrackermap-server-b5cfcc219cc9ab4c37077c4901f6e559e1519b13.tar.gz
trackermap-server-b5cfcc219cc9ab4c37077c4901f6e559e1519b13.tar.bz2
trackermap-server-b5cfcc219cc9ab4c37077c4901f6e559e1519b13.zip
Support Bofan PT500
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java
index 0afec67ad..ff92b51f1 100644
--- a/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2020 Anton Tananaev (anton@traccar.org)
* Copyright 2012 Luis Parada (luis.parada@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,8 +55,8 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder {
.expression("([EW]),")
.number("(d+.d+)?,") // speed
.number("(d+.d+)?,") // course
- .number("(dd)(dd)(dd),,,") // date (ddmmyy)
- .expression("./")
+ .number("(dd)(dd)(dd),,,?") // date (ddmmyy)
+ .expression(".?/")
.expression("([01])+,") // input
.expression("([01])+/") // output
.expression("([^/]+)?/") // adc
@@ -108,7 +108,7 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(deviceSession.getDeviceId());
DateBuilder dateBuilder = new DateBuilder()
- .setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));
+ .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt());
position.setValid(parser.next().equals("A"));
position.setLatitude(parser.nextCoordinate());
@@ -116,7 +116,7 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(parser.nextDouble(0));
position.setCourse(parser.nextDouble(0));
- dateBuilder.setDateReverse(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));
+ dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt());
position.setTime(dateBuilder.getDate());
position.set(Position.KEY_INPUT, parser.next());