Skip to content

Commit

Permalink
Take "steps" value from LK frames
Browse files Browse the repository at this point in the history
"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)
  • Loading branch information
l-e-o-n-c-e authored Jun 17, 2021
1 parent 467c46c commit 1889e44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/traccar/protocol/WatchProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ protected Object decode(
getLastLocation(position, null);

position.set(Position.KEY_BATTERY_LEVEL, Integer.parseInt(values[2]));

position.set(Position.KEY_STEPS, Integer.parseInt(values[0]));

return position;
}
}
Expand Down

0 comments on commit 1889e44

Please sign in to comment.