aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-02-20 20:33:19 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-02-20 20:33:19 -0800
commit0374520d2e43745de2653a9f838cb423bca1aff2 (patch)
treef9237f8627355a8938c005695405fc3bff540bfc
parent699c1568828a10be57879069c97bf9b27bdc7d07 (diff)
downloadtraccar-server-0374520d2e43745de2653a9f838cb423bca1aff2.tar.gz
traccar-server-0374520d2e43745de2653a9f838cb423bca1aff2.tar.bz2
traccar-server-0374520d2e43745de2653a9f838cb423bca1aff2.zip
Fix cell decoding
-rw-r--r--src/org/traccar/protocol/SuntechProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/SuntechProtocolDecoderTest.java5
2 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java
index d94bdb5c2..922431021 100644
--- a/src/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2013 - 2019 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -268,7 +268,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
position.setTime(dateFormat.parse(values[index++] + values[index++]));
if (!protocol.equals("ST500")) {
- int cid = Integer.parseInt(values[index++], 16);
+ long cid = Long.parseLong(values[index++], 16);
if (protocol.equals("ST600")) {
position.setNetwork(new Network(CellTower.from(
Integer.parseInt(values[index++]), Integer.parseInt(values[index++]),
diff --git a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java
index 23410c8c1..2681e6143 100644
--- a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java
@@ -45,6 +45,9 @@ public class SuntechProtocolDecoderTest extends ProtocolTest {
SuntechProtocolDecoder decoder = new SuntechProtocolDecoder(null);
verifyPosition(decoder, text(
+ "SA200STT;608945;129;20190215;15:04:53;3dce071558;+22.006721;-098.771016;001.198;000.00;11;1;2632589;12.21;010000;1;3211"));
+
+ verifyPosition(decoder, text(
"ST410STT;007272376;408;01;10217;732;103;-87;51511;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;3.8;1;2503;6;20181031;20:12:58;+04.741277;-074.048238;052.375;189.87;20;1"));
verifyPosition(decoder, text(
@@ -94,7 +97,7 @@ public class SuntechProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, text(
"SA200ALV;317652"));
-
+
verifyPosition(decoder, text(
"ST910;Alert;123456;410;20141018;18:30:12;+37.478774;+126.889690;000.000;000.00;0;4.0;1;6002"),
position("2014-10-18 18:30:12.000", false, 37.47877, 126.88969));