From 17b41acb3a2d5f4d33aeb2f021159ee17a75c556 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Fri, 15 May 2026 18:10:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E6=A0=87-=E5=85=BC=E9=80=9A808-2011?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/jt1078/proc/request/J0100.java | 14 +++++++++++--- .../iot/vmp/jt1078/proc/request/J0200.java | 5 ++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0100.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0100.java index 8be3abc4a..bbfe34646 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0100.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0100.java @@ -61,9 +61,17 @@ public class J0100 extends Re { buf.readBytes(bytes5); device.setMakerId(new String(bytes5).trim()); - byte[] bytes20 = new byte[20]; - buf.readBytes(bytes20); - device.setModel(new String(bytes20).trim()); + + if (buf.readableBytes() < 29) { + // 按照2011解析 + byte[] bytes8 = new byte[8]; + buf.readBytes(bytes8); + device.setModel(new String(bytes8).trim()); + }else { + byte[] bytes20 = new byte[20]; + buf.readBytes(bytes20); + device.setModel(new String(bytes20).trim()); + } byte[] bytes7 = new byte[7]; buf.readBytes(bytes7); diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0200.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0200.java index f42054027..e783f9d4a 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0200.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0200.java @@ -1,7 +1,8 @@ package com.genersoft.iot.vmp.jt1078.proc.request; import com.genersoft.iot.vmp.jt1078.annotation.MsgId; -import com.genersoft.iot.vmp.jt1078.bean.*; +import com.genersoft.iot.vmp.jt1078.bean.JTPositionAdditionalInfo; +import com.genersoft.iot.vmp.jt1078.bean.JTPositionBaseInfo; import com.genersoft.iot.vmp.jt1078.proc.Header; import com.genersoft.iot.vmp.jt1078.proc.response.J8001; import com.genersoft.iot.vmp.jt1078.proc.response.Rs; @@ -9,8 +10,6 @@ import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service; import com.genersoft.iot.vmp.jt1078.session.Session; import io.netty.buffer.ByteBuf; import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationEvent; /**