diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-11-07 04:45:23 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-11-07 04:45:23 +1300 |
commit | 5bd69427184618591da88161aa51ed00baa85a89 (patch) | |
tree | 78f42b907635c1f1171d51e477c5b6b868265149 | |
parent | cf55f4b6e14b9e8ce2b9c32833f9c232786dfae1 (diff) | |
download | trackermap-server-5bd69427184618591da88161aa51ed00baa85a89.tar.gz trackermap-server-5bd69427184618591da88161aa51ed00baa85a89.tar.bz2 trackermap-server-5bd69427184618591da88161aa51ed00baa85a89.zip |
Handle Sirra GNX-6 serial number
-rw-r--r-- | src/org/traccar/protocol/GenxProtocolDecoder.java | 1 | ||||
-rw-r--r-- | test/org/traccar/protocol/GenxProtocolDecoderTest.java | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/GenxProtocolDecoder.java b/src/org/traccar/protocol/GenxProtocolDecoder.java index ebf6f2b53..3b38227dc 100644 --- a/src/org/traccar/protocol/GenxProtocolDecoder.java +++ b/src/org/traccar/protocol/GenxProtocolDecoder.java @@ -55,6 +55,7 @@ public class GenxProtocolDecoder extends BaseProtocolDecoder { for (int i = 0; i < Math.min(values.length, reportColumns.length); i++) { switch (reportColumns[i]) { case 1: + case 28: DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, values[i]); if (deviceSession != null) { position.setDeviceId(deviceSession.getDeviceId()); diff --git a/test/org/traccar/protocol/GenxProtocolDecoderTest.java b/test/org/traccar/protocol/GenxProtocolDecoderTest.java index 9c49839c4..ee813b841 100644 --- a/test/org/traccar/protocol/GenxProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GenxProtocolDecoderTest.java @@ -10,6 +10,13 @@ public class GenxProtocolDecoderTest extends ProtocolTest { GenxProtocolDecoder decoder = new GenxProtocolDecoder(new GenxProtocol()); + decoder.setReportColumns("28,2,3,4,13,17,10,23,27,11,7,8,46,56,59,70,74,75,77,89,90,93,99,107,112,113,114,176,175,178,181,182"); + + verifyPosition(decoder, text( + "000036004133,11/05/2017 00:03:45,45.54767,-73.75547,0,0,63,569.35,118,ON,10687,0,12,O,9,3669.000,95.0,0.0,1,107.9464,0.0065,583.752,43,0.00,28.26,7.60,NA,U,UUU,0,-95.0,U")); + + decoder.setReportColumns("1,2,3,4"); + verifyPosition(decoder, text( "000036004130,08/31/2017 17:24:13,45.47275,-73.65491,5,19,117,1.14,147,ON,1462,0,6,N,0,0.000,-95.0,-1.0,0,0.0000,0.0000,0.000,0,0.00,0.00,0.00,NA,U,UUU,0,-95.0,U")); |