diff options
author | Abyss777 <abyss@fox5.ru> | 2017-09-26 11:57:08 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-09-26 11:57:08 +0500 |
commit | 152dde860450adb9ae8409d69f429f35ad1b3b13 (patch) | |
tree | 6ec95c3b0c6decfa9b27dd147779229f742c23b0 /test | |
parent | b5fc7e0899475547da99c06319ede5cc68f647e4 (diff) | |
download | traccar-server-152dde860450adb9ae8409d69f429f35ad1b3b13.tar.gz traccar-server-152dde860450adb9ae8409d69f429f35ad1b3b13.tar.bz2 traccar-server-152dde860450adb9ae8409d69f429f35ad1b3b13.zip |
Improve Teltonika IO decoding
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 7bff41acd..01395fc11 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -257,6 +257,10 @@ public class ProtocolTest extends BaseTest { Assert.assertTrue(attributes.get(Position.KEY_DRIVER_UNIQUE_ID) instanceof String); } + if (attributes.containsKey(Position.KEY_STEPS)) { + Assert.assertTrue(attributes.get(Position.KEY_STEPS) instanceof Number); + } + if (position.getNetwork() != null && position.getNetwork().getCellTowers() != null) { for (CellTower cellTower : position.getNetwork().getCellTowers()) { checkInteger(cellTower.getMobileCountryCode(), 0, 999); diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java index a945178a1..beae48d67 100644 --- a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java @@ -59,6 +59,12 @@ public class TeltonikaProtocolDecoderTest extends ProtocolTest { verifyPositions(decoder, binary( "00000000000000a608010000013f14a1d1ce000f0eb790209a778000ab010c0500000000000000000100003390")); + verifyPositions(decoder, binary( + "000000000000004508010000015eb70a86d00024089d4d21dee3860137005f12005f000e06ef01f00150011503c800450108b5000bb6000642382718005fcd057ace19d3430f57440000000001000002bf")); + + verifyPositions(decoder, binary( + "000000000000004a08010000015ebc1da508002411926621f15246010b00b913005e000f06ef01f00150011505c800450108b5000bb6000642381b18005ecd0318ce19cd430f5844000001f1000061a900010000c8e1")); + decoder.setExtended(true); verifyPositions(decoder, false, binary( |