aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-07-14 21:36:30 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-07-14 21:36:30 -0700
commit9d057f8c87af2df410f65e5f70f26c59b3192fcb (patch)
tree51c868e04402c4cac126c9576f29777ada37248c /src/main/java/org/traccar
parent3bfeece57b525f18be57856dce277473ca2cff95 (diff)
downloadtrackermap-server-9d057f8c87af2df410f65e5f70f26c59b3192fcb.tar.gz
trackermap-server-9d057f8c87af2df410f65e5f70f26c59b3192fcb.tar.bz2
trackermap-server-9d057f8c87af2df410f65e5f70f26c59b3192fcb.zip
Update ITS decoder
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/ItsProtocolDecoder.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
index 6a107d67d..1e0a4603c 100644
--- a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
@@ -56,7 +56,7 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
.expression("[^,]*,") // vehicle registration
.number("([01]),").optional() // valid
.groupEnd()
- .number("(dd),?(dd),?(d{2,4}),") // date (ddmmyyyy)
+ .number("(dd),?(dd),?(d{2,4}),?") // date (ddmmyyyy)
.number("(dd),?(dd),?(dd),") // time (hhmmss)
.expression("([01AV]),").optional() // valid
.number("(d+.d+),([NS]),") // latitude
@@ -203,7 +203,7 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
int lac = Integer.parseInt(cells[3], 16);
int cid = Integer.parseInt(cells[4], 16);
Network network = new Network(CellTower.from(mcc, mnc, lac, cid, Integer.parseInt(cells[0])));
- if (!cells[5].startsWith("(")) {
+ if (cells.length > 5 && !cells[5].startsWith("(")) {
for (int i = 0; i < 4; i++) {
lac = Integer.parseInt(cells[5 + 3 * i + 1], 16);
cid = Integer.parseInt(cells[5 + 3 * i + 2], 16);