From 613452b3fc863b9cc099f42e0794576c14285ed6 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 12 Mar 2024 18:21:10 +0800 Subject: [PATCH] =?UTF-8?q?1078-=E8=AE=BE=E5=A4=87=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=85=BC=E5=AE=B91078-2013?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/jt1078/proc/request/J0100.java | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 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 bcfda06bb..d3058017e 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 @@ -62,11 +62,30 @@ public class J0100 extends Re { throw new RuntimeException(e); } } else { - int i = buf.readUnsignedShort(); // decode as 2013 - } - // 发送终端注册消息 + cityId = buf.readUnsignedShort(); + // decode as 2019 + byte[] bytes5 = new byte[5]; + buf.readBytes(bytes5); + makerId = new String(bytes5).trim(); + byte[] bytes20 = new byte[20]; + buf.readBytes(bytes20); + deviceModel = new String(bytes20).trim(); + + byte[] bytes7 = new byte[7]; + buf.readBytes(bytes7); + deviceId = new String(bytes7).trim(); + + plateColor = buf.readByte(); + byte[] plateColorBytes = new byte[buf.readableBytes()]; + buf.readBytes(plateColorBytes); + try { + plateNo = new String(plateColorBytes, "GBK").trim(); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } return null; }