From 34ad0023c881c97297fa3dfbf0da70a9938214a2 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Wed, 27 Nov 2024 08:44:34 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=8E=B7=E5=8F=96=E5=AD=97=E8=8A=82?= =?UTF-8?q?=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/common/core/domain/ykc/YKCDataProtocol.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jsowell-common/src/main/java/com/jsowell/common/core/domain/ykc/YKCDataProtocol.java b/jsowell-common/src/main/java/com/jsowell/common/core/domain/ykc/YKCDataProtocol.java index 67de4b837..861c2c229 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/core/domain/ykc/YKCDataProtocol.java +++ b/jsowell-common/src/main/java/com/jsowell/common/core/domain/ykc/YKCDataProtocol.java @@ -61,13 +61,20 @@ public class YKCDataProtocol { this.crcByte = new byte[]{msg[msg.length - 2], msg[msg.length - 1]}; } + /** + * 获取字节数组 + */ + public byte[] getBytes() { + return Bytes.concat(this.head, this.length, this.serialNumber, this.encryptFlag, this.frameType, this.msgBody, this.crcByte); + } + /** * 转换为十六进制字符串 * * @return 报文 */ public String getHEXString() { - byte[] bytes = Bytes.concat(this.head, this.length, this.serialNumber, this.encryptFlag, this.frameType, this.msgBody, this.crcByte); + byte[] bytes = getBytes(); return BytesUtil.binary(bytes, 16); } }