diff options
author | anton2920 <anton2920@gmail.com> | 2022-07-24 19:18:49 +0100 |
---|---|---|
committer | anton2920 <anton2920@gmail.com> | 2022-09-07 09:48:53 +0100 |
commit | 26e3d616ef17db2c30da0e9c8c0a7a1e9182cc6c (patch) | |
tree | 50e508b716558438e426b0e1913a041817484282 /src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java | |
parent | b66d4c3b3250edac4762176277f4f07bc2e74d8e (diff) | |
download | trackermap-server-26e3d616ef17db2c30da0e9c8c0a7a1e9182cc6c.tar.gz trackermap-server-26e3d616ef17db2c30da0e9c8c0a7a1e9182cc6c.tar.bz2 trackermap-server-26e3d616ef17db2c30da0e9c8c0a7a1e9182cc6c.zip |
Added workaround for 'ALARM KEY;'
Diffstat (limited to 'src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java index 775032b64..d1f667f6f 100644 --- a/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java @@ -173,8 +173,8 @@ public class PiligrimProtocolDecoder extends BaseHttpProtocolDecoder { */ String[] payload_parts = payload.split("&"); /* System.out.println("Payload parts: " + Arrays.toString(payload_parts)); */ - String phone_number = payload_parts[1].substring(15); - String message = payload_parts[2].substring(8); + /* String phone_number = payload_parts[1].substring(15); */ + String message = payload_parts[2].substring(8).replaceFirst("ALARM KEY; ", ""); /* System.out.println("Phone number: " + phone_number); */ /* System.out.println("Message: " + message); */ @@ -220,6 +220,7 @@ public class PiligrimProtocolDecoder extends BaseHttpProtocolDecoder { position.setSpeed(gps_position.velocity); position.setCourse(gps_position.dir); position.setAccuracy(gps_position.quality); + position.setAltitude(gps_position.altitude); position.set(Position.KEY_BATTERY, Integer.parseInt(battery_info) / 100); System.out.println("Supported message finish"); |