diff options
-rw-r--r-- | src/org/traccar/protocol/Tlt2hProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java index 60f624dd6..531ae28b6 100644 --- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java +++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java @@ -60,7 +60,7 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { // Get device identifier String imei = sentence.substring(1, sentence.indexOf('#', 1)); - long deviceId = 0; + long deviceId; try { deviceId = getDataManager().getDeviceByImei(imei).getId(); } catch(Exception error) { diff --git a/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java b/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java index 9c2324be7..8660e733c 100644 --- a/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tlt2hProtocolDecoderTest.java @@ -10,6 +10,10 @@ public class Tlt2hProtocolDecoderTest { Tlt2hProtocolDecoder decoder = new Tlt2hProtocolDecoder(null); decoder.setDataManager(new TestDataManager()); + + assertNotNull(decoder.decode(null, null, + "#357671030938911#V500#0000#AUTOSTOP#1\r\n" + + "#00b34d3c$GPRMC,140026.000,A,2623.6452,S,02828.8990,E,0.00,65.44,130213,,,A*4B\r\n")); assertNotNull(decoder.decode(null, null, "#123456789000001#V3338#0000#SMS#3\r\n" + |