aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-03-08 06:52:02 -0800
committerAnton Tananaev <anton@traccar.org>2024-03-08 06:52:02 -0800
commit04e482bd22029710fd512bfd7916781cd5c79495 (patch)
tree3a7a2a39651f2237691ea231d64d650febef96f7 /src
parent75b404db5c790bf37c05fabf1cbbd2027ad1db25 (diff)
downloadtrackermap-server-04e482bd22029710fd512bfd7916781cd5c79495.tar.gz
trackermap-server-04e482bd22029710fd512bfd7916781cd5c79495.tar.bz2
trackermap-server-04e482bd22029710fd512bfd7916781cd5c79495.zip
Fix Esky ES840 decoding
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/EskyProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java b/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java
index 4239022d0..14b6aaa5a 100644
--- a/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/EskyProtocolDecoder.java
@@ -49,7 +49,7 @@ public class EskyProtocolDecoder extends BaseProtocolDecoder {
.number("(d+.d+)[+;]") // speed
.number("(d+)[+;]") // course
.groupBegin()
- .text("0x").number("(d+)[+;]") // input
+ .text("0x").number("(x+)[+;]") // input
.number("(d+)[+;]") // message type
.number("(d+)[+;]") // odometer
.groupEnd("?")
diff --git a/src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java
index feec3ebfb..26132eb4e 100644
--- a/src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class EskyProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new EskyProtocolDecoder(null));
+ verifyPosition(decoder, text(
+ "ET;1;864431045310325;R;0+240303180628+-33.40958+149.56797+0.00+63+0xb+0+17814846+1168+0+0+WVWZZZ6RZFY242201+135+DTCNULL"));
+
verifyAttribute(decoder, text(
"ET;0;860337031066546;R;9+200717114059+41.32053+19.80761+0.30+0+0x2+8+40381744+0+1409+11"),
Position.KEY_BATTERY, 14.09);