aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-10-08 22:20:13 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-10-08 22:20:13 -0700
commite7ba2f77c7e9c9f1065b31a337715b94f43afe26 (patch)
treeaeddf4c05af52322a7e8e2e75bf7fa10b1a25970 /src
parentd2c24e28111e351f392ac0e579f4f1d443ebcf1d (diff)
downloadtrackermap-server-e7ba2f77c7e9c9f1065b31a337715b94f43afe26.tar.gz
trackermap-server-e7ba2f77c7e9c9f1065b31a337715b94f43afe26.tar.bz2
trackermap-server-e7ba2f77c7e9c9f1065b31a337715b94f43afe26.zip
Handle long status field
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
index 458e92065..40e146e0b 100644
--- a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
@@ -60,7 +60,7 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder {
.number("(-?d+),") // altitude
.number("(d+),") // odometer
.number("d+,") // runtime
- .number("(xxxx),") // status
+ .number("(x{4,8}),") // status
.number("(x+)?,") // input
.number("(x+)?,") // output
.number("(d+)|") // mcc
@@ -151,7 +151,7 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder {
position.setAltitude(parser.nextInt());
position.set(Position.KEY_ODOMETER, parser.nextLong());
- position.set(Position.KEY_STATUS, parser.nextHexInt());
+ position.set(Position.KEY_STATUS, parser.nextHexLong());
position.set(Position.KEY_INPUT, parser.nextHexInt());
position.set(Position.KEY_OUTPUT, parser.nextHexInt());
diff --git a/src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java
index 2e75a180f..88a460854 100644
--- a/src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class FifotrackProtocolDecoderTest extends ProtocolTest {
FifotrackProtocolDecoder decoder = new FifotrackProtocolDecoder(null);
+ verifyPosition(decoder, buffer(
+ "$$116,869270049149999,5,A01,4,190925080127,V,-15.804260,35.061506,0,0,1198,0,0,900000C0,02,0,650|10|12C|B24,18B|4C8|72,1,*01"));
+
verifyAttribute(decoder, buffer(
"$$123,869467049296388,B996,A01,2,190624131813,V,22.333746,113.590670,0,124,-1,26347,0,0004,00,0,460|0|2694|5A5D,174|0|0|0,B48CEB,*77"),
Position.KEY_ALARM, Position.ALARM_SOS);