aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-06-01 23:11:02 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-06-01 23:11:02 +1200
commit77a475886aea9604030efd5e5deeb634990312f3 (patch)
tree565a6b613cf879a74354ce5f196258b3efd692cd
parent7de54a8363cb3e24a7c53c6c3dfb8c17c2957b30 (diff)
downloadtrackermap-server-77a475886aea9604030efd5e5deeb634990312f3.tar.gz
trackermap-server-77a475886aea9604030efd5e5deeb634990312f3.tar.bz2
trackermap-server-77a475886aea9604030efd5e5deeb634990312f3.zip
Fix FlexComm time decoding
-rw-r--r--src/org/traccar/protocol/FlexCommProtocolDecoder.java6
-rw-r--r--test/org/traccar/protocol/FlexCommProtocolDecoderTest.java3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/FlexCommProtocolDecoder.java b/src/org/traccar/protocol/FlexCommProtocolDecoder.java
index 086a2de0b..33b4c0abb 100644
--- a/src/org/traccar/protocol/FlexCommProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlexCommProtocolDecoder.java
@@ -89,8 +89,8 @@ public class FlexCommProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(deviceSession.getDeviceId());
- position.setValid(parser.next().equals("1"));
position.setTime(parser.nextDateTime());
+ position.setValid(parser.next().equals("1"));
position.setLatitude(parseSignedValue(parser, 6));
position.setLongitude(parseSignedValue(parser, 6));
position.setAltitude(parseSignedValue(parser, 0));
@@ -104,8 +104,8 @@ public class FlexCommProtocolDecoder extends BaseProtocolDecoder {
position.setNetwork(new Network(CellTower.from(
parser.nextInt(), parser.nextInt(), parser.nextHexInt(), parser.nextHexInt())));
- position.set(Position.KEY_INPUT, parser.nextInt());
- position.set(Position.KEY_OUTPUT, parser.nextInt());
+ position.set(Position.KEY_INPUT, parser.nextBinInt());
+ position.set(Position.KEY_OUTPUT, parser.nextBinInt());
position.set(Position.KEY_FUEL_LEVEL, parser.nextInt());
position.set(Position.PREFIX_TEMP + 1, parseSignedValue(parser, 0));
position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());
diff --git a/test/org/traccar/protocol/FlexCommProtocolDecoderTest.java b/test/org/traccar/protocol/FlexCommProtocolDecoderTest.java
index 393c45793..e1a382936 100644
--- a/test/org/traccar/protocol/FlexCommProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/FlexCommProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class FlexCommProtocolDecoderTest extends ProtocolTest {
FlexCommProtocolDecoder decoder = new FlexCommProtocolDecoder(new FlexCommProtocol());
verifyPosition(decoder, text(
+ "7E00865067022408382201705302358271024932258006712785200700022601010224100040002C5002A2210001000000010012342107"));
+
+ verifyPosition(decoder, text(
"7E27865067022408382201705241211301024932197006712794000910022481008234100040002C5002A2200011000000006306941827"));
}