From 17d6db44d6a7f6beacb1a73594d96430063e3d33 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 4 Jul 2024 14:35:14 -0700 Subject: Fix Kingwo GPS cell info --- src/main/java/org/traccar/protocol/UproProtocolDecoder.java | 2 +- src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/traccar/protocol/UproProtocolDecoder.java b/src/main/java/org/traccar/protocol/UproProtocolDecoder.java index 8d2e5de0a..d3f9882dd 100644 --- a/src/main/java/org/traccar/protocol/UproProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/UproProtocolDecoder.java @@ -298,7 +298,7 @@ public class UproProtocolDecoder extends BaseProtocolDecoder { mcc, mnc, Integer.parseInt(stringValue.substring(offset, offset + 4), 16), Long.parseLong(stringValue.substring(offset + 4, offset + 12), 16), - Integer.parseInt(stringValue.substring(offset + 12, offset + 14)))); + Integer.parseInt(stringValue.substring(offset + 12, offset + 14), 16))); } } else { position.set(Position.KEY_POWER, diff --git a/src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java index f070c6201..ac9c83e01 100644 --- a/src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class UproProtocolDecoderTest extends ProtocolTest { var decoder = inject(new UproProtocolDecoder(null)); + verifyPosition(decoder, buffer( + "*HQ200862406278000161,AB1&A1103312243149711422697470000040724&B0100000000&F0000&R2900&N04&Y3246011F4202C1460D351F4202C146113A1F4204C1460B3C&Q06f4911e6155e127b04e2640509e325091e3cc45ed4e788a20e024a151f81a679be2a45250d4f7e7dff75b&T63&J000300&K00100&X(k89882280666065148193)(10)(J0000)(PMODE,0,10)(20)(5000A)#")); + verifyPosition(decoder, buffer( "*HQ201999999,BA&A1656512233362911356523660000230618&B0100060010&C00000<6<&F0000&R2405&V0109&W0000003E&K00100&T65&I54600027A00FCB6227A00FCA5727A00E955327A00E8B5327A00F9748&Y54600027A000000FCB6227A000000FCA5727A000000E955327A000000E8B5327A000000F9748&b00A7E81007607#")); -- cgit v1.2.3