From 023ab3249c1cbeb89e44af0d9f6c98130519a67d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Sep 2023 19:09:54 -0700 Subject: Add missing Ramac attributes --- .../java/org/traccar/protocol/RamacProtocolDecoder.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') 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")); -- cgit v1.2.3