部标-兼通808-2011设备注册

This commit is contained in:
lin 2026-05-15 18:10:53 +08:00
parent 562df5f739
commit 17b41acb3a
2 changed files with 13 additions and 6 deletions

View File

@ -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);

View File

@ -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;
/**