diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-07-17 20:28:52 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-07-17 20:28:52 -0700 |
commit | e8741d7ddc28b9c2db3865129368f0a8eaa6b032 (patch) | |
tree | 30cd1c4254e8af96e84fe47752784928a2c6c99f /src/main/java/org | |
parent | b6cdfb459241f0a71f5ff9ce35814656465597dc (diff) | |
download | trackermap-server-e8741d7ddc28b9c2db3865129368f0a8eaa6b032.tar.gz trackermap-server-e8741d7ddc28b9c2db3865129368f0a8eaa6b032.tar.bz2 trackermap-server-e8741d7ddc28b9c2db3865129368f0a8eaa6b032.zip |
Fix battery decoding
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/EskyProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java b/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java index 1a4f9b906..14b4376d5 100644 --- a/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java @@ -53,6 +53,7 @@ public class EskyProtocolDecoder extends BaseProtocolDecoder { .number("(d+)[+;]") // message type .number("(d+)[+;]") // odometer .groupEnd("?") + .number("(d+)[+;]") // adc 1 .number("(d+)") // voltage .any() .compile(); @@ -93,7 +94,8 @@ public class EskyProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.nextInt()); } - position.set(Position.KEY_BATTERY, parser.nextInt() * 0.001); + position.set(Position.PREFIX_ADC + 1, parser.nextInt()); + position.set(Position.KEY_BATTERY, parser.nextInt() * 0.01); int index = sentence.lastIndexOf('+'); if (index > 0 && channel instanceof DatagramChannel) { |