aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-03-28 09:54:04 -0700
committerAnton Tananaev <anton@traccar.org>2022-03-28 09:54:21 -0700
commit4350c1634b7cfd1e8005908b8c72ec32a882276f (patch)
treec48ddc5e9223f061431e03bf91007568d304deb1
parent80dd9eebab6cb90761d325852536395879d9412f (diff)
downloadtrackermap-server-4350c1634b7cfd1e8005908b8c72ec32a882276f.tar.gz
trackermap-server-4350c1634b7cfd1e8005908b8c72ec32a882276f.tar.bz2
trackermap-server-4350c1634b7cfd1e8005908b8c72ec32a882276f.zip
Handle invalid operator
-rw-r--r--src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 89ae48b3a..f83a49941 100644
--- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -362,7 +362,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
if (cid != 0 && lac != 0) {
CellTower cellTower = CellTower.fromLacCid(lac, cid);
long operator = position.getInteger(Position.KEY_OPERATOR);
- if (operator != 0) {
+ if (operator >= 1000) {
cellTower.setOperator(operator);
}
position.setNetwork(new Network(cellTower));
diff --git a/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
index 082d410c2..c3c32369c 100644
--- a/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
@@ -15,6 +15,9 @@ public class TeltonikaProtocolDecoderTest extends ProtocolTest {
"000F313233343536373839303132333435"));
verifyPositions(decoder, binary(
+ "00000000000000da08030000017fcedf499600280431be0eded45d0038012d100000fa100901000200b300b4004501500415034702fa00054232a1180000cd3b2fce281d43001f02c700000006f10000a029000000017fcedea99600280432070eded3dd00380046130009000f0801010200b300b400450150051502470205423276180009cd3b2fce281d43001f02c700000027f10000a0290000000179d50853180027f65d3f0ed67212001500f1110061000f0801010200b300b4004501500515034702054234f4180061cd53d1ce28c043003e02c700000147f1000000290003000052cb"));
+
+ verifyPositions(decoder, binary(
"00000000000000b98e0200000179555c7bf8010b3a1cfbebc142b00000000000000000ec000f000900f00000150000c80000450200710100740001070100fa0000ec01000500b500000018000000430d560044000000190000000100f1000000000000000000000179555c83c8010b3a1cfbebc142b0000000000000000185000f000900f00000150000c80000450200710100740001070100fa00018511000500b500000018000000430d560044000000190000000100f100000000000000000200003251"));
verifyPositions(decoder, binary(