From e8741d7ddc28b9c2db3865129368f0a8eaa6b032 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 17 Jul 2020 20:28:52 -0700 Subject: Fix battery decoding --- src/main/java/org/traccar/protocol/EskyProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar') 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) { -- cgit v1.2.3