aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-10-11 20:10:38 -0700
committerGitHub <noreply@github.com>2021-10-11 20:10:38 -0700
commit7e50d16b6dd99882c53db9d4af3e48548749b78d (patch)
tree41421eb6fe51169b2093fbdc02091d6fcb6339e4 /src
parent1ed18df76447d01ace02ec29856d4bd9c7720e83 (diff)
parentf643887684f3dff65a954fba1ada36e8b81db9d3 (diff)
downloadtrackermap-server-7e50d16b6dd99882c53db9d4af3e48548749b78d.tar.gz
trackermap-server-7e50d16b6dd99882c53db9d4af3e48548749b78d.tar.bz2
trackermap-server-7e50d16b6dd99882c53db9d4af3e48548749b78d.zip
Merge pull request #4750 from jcardus/patch-6
Update MobilogixProtocolDecoder.java
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java3
-rw-r--r--src/test/java/org/traccar/protocol/MobilogixProtocolDecoderTest.java3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java b/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java
index 8677ba9ec..ac75841a4 100644
--- a/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java
@@ -39,7 +39,7 @@ public class MobilogixProtocolDecoder extends BaseProtocolDecoder {
.text("[")
.number("(dddd)-(dd)-(dd) ") // date (yyyymmdd)
.number("(dd):(dd):(dd),") // time (hhmmss)
- .number("Td,") // type
+ .number("Td+,") // type
.number("d+,") // device type
.expression("[^,]+,") // protocol version
.expression("([^,]+),") // serial number
@@ -86,6 +86,7 @@ public class MobilogixProtocolDecoder extends BaseProtocolDecoder {
if (deviceSession == null) {
return null;
}
+ position.set(Position.KEY_TYPE, type);
position.setDeviceId(deviceSession.getDeviceId());
int status = parser.nextHexInt();
diff --git a/src/test/java/org/traccar/protocol/MobilogixProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MobilogixProtocolDecoderTest.java
index dc60edb15..aff4e42a6 100644
--- a/src/test/java/org/traccar/protocol/MobilogixProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/MobilogixProtocolDecoderTest.java
@@ -16,6 +16,9 @@ public class MobilogixProtocolDecoderTest extends ProtocolTest {
verifyPosition(decoder, text(
"[2020-12-01 12:01:09,T3,1,V1.1.1,201951132031,3B,12.99,022,-23.563410,-46.588055,0,0"));
+ verifyPosition(decoder, text(
+ "[2021-09-30 20:06:35,T21,1,V1.3.5,201950130047,37,14.97,092,-23.494715,-46.851341,0,240,4.08,0,19516,4431,0.78,724,10,09111,00771,31,4680"));
+
}
}