diff options
author | Anton Tananaev <anton@traccar.org> | 2023-09-09 19:09:54 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-09-09 19:09:54 -0700 |
commit | 023ab3249c1cbeb89e44af0d9f6c98130519a67d (patch) | |
tree | a98137432d99d4eda296bccb483800b38b3e5d1c | |
parent | 2dcc3e0ee0ac637ca85e2457dc3d12c4edc01ec4 (diff) | |
download | trackermap-server-023ab3249c1cbeb89e44af0d9f6c98130519a67d.tar.gz trackermap-server-023ab3249c1cbeb89e44af0d9f6c98130519a67d.tar.bz2 trackermap-server-023ab3249c1cbeb89e44af0d9f6c98130519a67d.zip |
Add missing Ramac attributes
-rw-r--r-- | src/main/java/org/traccar/protocol/RamacProtocolDecoder.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/RamacProtocolDecoder.java b/src/main/java/org/traccar/protocol/RamacProtocolDecoder.java index ffe04a298..ffdc68474 100644 --- a/src/main/java/org/traccar/protocol/RamacProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/RamacProtocolDecoder.java @@ -71,9 +71,22 @@ public class RamacProtocolDecoder extends BaseHttpProtocolDecoder { } } + if (json.containsKey("GpsEvent")) { + position.set("gpsEvent", json.getInt("GpsEvent")); + if (json.containsKey("GpsEventText")) { + position.set("gpsEventText", json.getString("GpsEventText")); + } + } + if (json.containsKey("Event")) { position.set(Position.KEY_EVENT, json.getInt("Event")); } + if (json.containsKey("BatteryPercentage")) { + position.set(Position.KEY_BATTERY_LEVEL, json.getInt("BatteryPercentage")); + } + if (json.containsKey("Battery")) { + position.set(Position.KEY_BATTERY, json.getJsonNumber("Battery").doubleValue()); + } position.set("deviceType", json.getString("DeviceTypeText")); |