aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-07-17 20:28:52 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-07-17 20:28:52 -0700
commite8741d7ddc28b9c2db3865129368f0a8eaa6b032 (patch)
tree30cd1c4254e8af96e84fe47752784928a2c6c99f /src/main/java/org/traccar/protocol
parentb6cdfb459241f0a71f5ff9ce35814656465597dc (diff)
downloadtrackermap-server-e8741d7ddc28b9c2db3865129368f0a8eaa6b032.tar.gz
trackermap-server-e8741d7ddc28b9c2db3865129368f0a8eaa6b032.tar.bz2
trackermap-server-e8741d7ddc28b9c2db3865129368f0a8eaa6b032.zip
Fix battery decoding
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/EskyProtocolDecoder.java4
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) {