From 1889e442d55a659746d163558a33684f952bfa94 Mon Sep 17 00:00:00 2001 From: l-e-o-n-c-e <38976766+l-e-o-n-c-e@users.noreply.github.com> Date: Thu, 17 Jun 2021 13:51:04 +0200 Subject: 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) --- src/main/java/org/traccar/protocol/WatchProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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; } } -- cgit v1.2.3