aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorl-e-o-n-c-e <38976766+l-e-o-n-c-e@users.noreply.github.com>2021-06-17 13:51:04 +0200
committerGitHub <noreply@github.com>2021-06-17 13:51:04 +0200
commit1889e442d55a659746d163558a33684f952bfa94 (patch)
tree449c01975a1cbf2e291cd41a9445f987c334b15d /src/main/java
parent467c46ca1c35c7daa2c127ee758e378f151171a0 (diff)
downloadtrackermap-server-1889e442d55a659746d163558a33684f952bfa94.tar.gz
trackermap-server-1889e442d55a659746d163558a33684f952bfa94.tar.bz2
trackermap-server-1889e442d55a659746d163558a33684f952bfa94.zip
Take "steps" value from LK frames
"Steps" counter value is currently parsed from a complete GPS frame ony, but according to the protocol it is also transmitted in all "LK" keepalive frames, as well as the battery level. Example : [3G*123456789*000D*LK,1234,0,98] means 1234 steps counted and 98% battery level. Note : for this value to be incremented, the device should receive a 'PEDO,1' command (and 'PEDO,0' to stop the counter)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/WatchProtocolDecoder.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
index d060826cf..351584e8b 100644
--- a/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
@@ -244,7 +244,8 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, null);
position.set(Position.KEY_BATTERY_LEVEL, Integer.parseInt(values[2]));
-
+ position.set(Position.KEY_STEPS, Integer.parseInt(values[0]));
+
return position;
}
}