From b7d405e9d5cc64b88dfd09cd43d621338f550d68 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 29 Jan 2024 20:43:38 -0800 Subject: Minor FleetGuide updates --- src/main/java/org/traccar/protocol/FleetGuideProtocolDecoder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/traccar/protocol/FleetGuideProtocolDecoder.java b/src/main/java/org/traccar/protocol/FleetGuideProtocolDecoder.java index d63187921..4e5de2b3e 100644 --- a/src/main/java/org/traccar/protocol/FleetGuideProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/FleetGuideProtocolDecoder.java @@ -43,12 +43,12 @@ public class FleetGuideProtocolDecoder extends BaseProtocolDecoder { ByteBuf buf = (ByteBuf) msg; buf.readUnsignedByte(); // signature - int options = buf.readUnsignedShort(); + int options = buf.readUnsignedShortLE(); int length = BitUtil.to(options, 11); DeviceSession deviceSession; if (BitUtil.check(options, 11)) { - deviceSession = getDeviceSession(channel, remoteAddress, String.valueOf(buf.readUnsignedInt())); + deviceSession = getDeviceSession(channel, remoteAddress, String.valueOf(buf.readUnsignedIntLE())); } else { deviceSession = getDeviceSession(channel, remoteAddress); } @@ -64,7 +64,7 @@ public class FleetGuideProtocolDecoder extends BaseProtocolDecoder { } if (BitUtil.check(options, 13)) { - buf.readUnsignedShort(); // acknowledgement + buf.readUnsignedShortLE(); // acknowledgement } ByteBuf data; @@ -84,6 +84,7 @@ public class FleetGuideProtocolDecoder extends BaseProtocolDecoder { Class clazz = Class.forName("io.netty.handler.codec.compression.FastLz"); Method method = clazz.getDeclaredMethod( "decompress", ByteBuf.class, int.class, int.class, ByteBuf.class, int.class, int.class); + method.setAccessible(true); ByteBuf output = Unpooled.buffer(); int result = (Integer) method.invoke( -- cgit v1.2.3