Ver Fonte

慷慨斯GK309协议校时包/打卡包回复fix bug

vinson há 5 anos atrás
pai
commit
be49d8108f

+ 2 - 2
src/main/java/com/tidecloud/dataacceptance/service/impl/GK309GpsServerHandler.java

@@ -133,8 +133,8 @@ public class GK309GpsServerHandler extends HexBinaryAcceptanceHandlerAdapter {
                 short terminalReservedWord = in.readShort();
                 byte[] reservedWorkBytes = short2Bytes(terminalReservedWord);
 
-                // 减去前面跳过的7位,再减去最后的两位(校验位)
-                in.skipBytes(length - 7 - 2);
+                // 减去前面跳过的第一位和前面跳过的7位,再减去最后的四位(序列号本身的2位+校验位2位)
+                in.skipBytes(length - 8 - 2 - 2);
                 short serNum = in.readShort();
                 byte[] serNumBytes = short2Bytes(serNum);