diff options
author | Anton Tananaev <anton@traccar.org> | 2023-07-04 07:25:53 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-07-04 07:25:53 -0700 |
commit | 8b4d3ee0b96407ad3c889bc3bb0261e5ebe60532 (patch) | |
tree | f6ddf0d064f25700a5db4e938feb0339abcfba9b /src/main | |
parent | 5e18cb586d34aa3db0417cef9635bf1d9cae6e18 (diff) | |
download | trackermap-server-8b4d3ee0b96407ad3c889bc3bb0261e5ebe60532.tar.gz trackermap-server-8b4d3ee0b96407ad3c889bc3bb0261e5ebe60532.tar.bz2 trackermap-server-8b4d3ee0b96407ad3c889bc3bb0261e5ebe60532.zip |
Minifinder decode phone numbers
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java b/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java index f2e5eb905..1fdb1ece0 100644 --- a/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MiniFinderProtocolDecoder.java @@ -143,7 +143,7 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder { } DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); - if (deviceSession == null || !sentence.matches("![35A-D],.*")) { + if (deviceSession == null || !sentence.matches("![345A-D],.*")) { return null; } @@ -161,6 +161,20 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder { return position; + } else if (type.equals("4")) { + + String[] values = sentence.split(","); + + getLastLocation(position, null); + + for (int i = 1; i <= 3; i++) { + if (!values[i + 1].isEmpty()) { + position.set("phone" + i, values[i + 1]); + } + } + + return position; + } else if (type.equals("5")) { String[] values = sentence.split(","); |