From cd2854c7dba0e24622552e7d5805e4b0ec7fde3c Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 21 十一月 2024 09:08:02 +0800
Subject: [PATCH] 上传升级程序表单时,增加对升级程序存放地址和程序覆盖超始地址的判断。
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/global/GlCreate.java | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/global/GlCreate.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/global/GlCreate.java
index b9a916e..634534a 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/global/GlCreate.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1/parse/global/GlCreate.java
@@ -52,6 +52,17 @@
bsNoTail[ProtocolConstantV206V1.dataLenIndex] = (byte)len ;
}
+ public static void createLen4PUg(byte[] bytes) throws Exception {
+ int len = bytes.length - 4;
+ byte[] bs = ByteUtil.int2BCD_LE(len) ;
+ if(bs != null && bs.length == 1){
+ bytes[1] = bs[0] ;
+ }else if(bs != null && bs.length > 1){
+ bytes[1] = bs[0] ;
+ bytes[2] = bs[1] ;
+ }
+ }
+
/**
* 鐢熸垚IC鍗$紪鐮�
@@ -81,9 +92,9 @@
}
public static byte[] createCrcTail4Ug(byte[] bsNoTail) throws Exception {
- int crc = new CRC16().CRC(bsNoTail, 0, bsNoTail.length -1) ;
+ short crc = new CRC16().CRC(bsNoTail, 0, bsNoTail.length -1) ;
byte[] bytes = new byte[ProtocolConstantV206V1.UG_lenTail] ;
- ByteUtilUnsigned.short2Bytes_BE(bytes, crc, 0);
+ ByteUtil.short2Bytes_BE(bytes, crc, 0);
bytes[2] = ProtocolConstantV206V1.P_Tail_Byte ;
return bytes ;
}
--
Gitblit v1.8.0