aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-05 07:25:59 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-05 07:25:59 -0700
commit525fb440430343a73a8ed402677fa24c01262372 (patch)
tree168dc3b2cabae26d1fda8d2dd372d22e0af4bfc8 /src
parent205ed7965ae97ee6cf14deb8ec4dc94cdae75dfe (diff)
downloadtrackermap-server-525fb440430343a73a8ed402677fa24c01262372.tar.gz
trackermap-server-525fb440430343a73a8ed402677fa24c01262372.tar.bz2
trackermap-server-525fb440430343a73a8ed402677fa24c01262372.zip
Additional RFTRACK data
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java
index b3ebbbf9a..be9b23e37 100644
--- a/src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/RfTrackProtocolDecoder.java
@@ -73,7 +73,29 @@ public class RfTrackProtocolDecoder extends BaseHttpProtocolDecoder {
position.setDeviceTime(new Date(Long.parseLong(value)));
break;
case "bat":
- position.set(Position.KEY_BATTERY_LEVEL, Integer.parseInt(value) & 0xff);
+ int battery = Integer.parseInt(value);
+ position.set(Position.KEY_BATTERY_LEVEL, battery & 0xff);
+ position.set("plugStatus", (battery >> 8) & 0x0f);
+ position.set(Position.KEY_CHARGE, ((battery >> 12) & 0x0f) == 1);
+ break;
+ case "id":
+ position.set("braceletId", value);
+ break;
+ case "rc":
+ int braceletCode = Integer.parseInt(value);
+ position.set("braceletCode", braceletCode & 0xffff);
+ position.set("braceletStatus", braceletCode >> 16);
+ break;
+ case "idt":
+ long braceletTime = Long.parseLong(value);
+ position.set("lastHeartbeat", (braceletTime >> 45) * 10);
+ position.set("lastPaired", ((braceletTime >> 30) & 0xffff) * 10);
+ position.set("lastUnpaired", ((braceletTime >> 15) & 0xffff) * 10);
+ break;
+ case "mt":
+ int vibrationTime = Integer.parseInt(value);
+ position.set("vibrationDevice", (vibrationTime & 0x7fff) * 10);
+ position.set("vibrationBracelet", (vibrationTime >> 15) * 10);
break;
case "gps":
JsonObject location = Json.createReader(new StringReader(value)).readObject();
@@ -95,6 +117,18 @@ public class RfTrackProtocolDecoder extends BaseHttpProtocolDecoder {
mcc, mnc, cell.getInt("l"), cell.getInt("c"), cell.getInt("b")));
}
break;
+ case "dbm":
+ position.set(Position.KEY_RSSI, Integer.parseInt(value));
+ break;
+ case "bar":
+ position.set("pressure", Double.parseDouble(value));
+ break;
+ case "cob":
+ position.set("pressureChanges", value);
+ break;
+ case "u_ids":
+ position.set("unpairedIds", value);
+ break;
default:
break;
}