From 38e4e60bb1fce4d2a8fe95adba35ec06d868412a Mon Sep 17 00:00:00 2001 From: panlili2024 <14743743+panlili2024@user.noreply.gitee.com> Date: 星期二, 31 十二月 2024 16:42:14 +0800 Subject: [PATCH] 代码同步 --- HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java b/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java index 883e261..edb326e 100644 --- a/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java +++ b/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/protocol/LinkMessageDecoder.java @@ -119,7 +119,7 @@ @Override - protected synchronized LinkResponse decoder(Object msg) throws Exception { + protected synchronized LinkResponse decoder(Object msg,String ipaddress) throws Exception { if (msg instanceof byte[]) { bytes.addAll(ByteUtils.toByteList((byte[]) msg)); //濡傛灉澶氭潯鍛戒护鎵撳寘鍦ㄤ竴鏉℃暟鎹腑锛岄兘闇�瑕佸鐞嗗畬 @@ -157,6 +157,7 @@ bytes.add(recevieBytes[i]); } LinkResponse response = new LinkResponse(); + response.setSource_ipAddress(ipaddress); response.setTopic(topic); if (HDLLinkConfig.getInstance().ifNeedEncrypt(response.getTopic())) { //闇�瑕佽В瀵� @@ -182,7 +183,8 @@ response.setData(bodyString); LogUtils.i( "鎺ユ敹鍒版暟鎹�:" + response.getTopic() + "\r\n" + response.getData()); //闈炴甯告暟鎹紝杩斿洖 - if (!(bodyString.startsWith("{") || bodyString.startsWith("["))) { + if (!((bodyString.startsWith("{") &&bodyString.endsWith("}")) + || (bodyString.startsWith("[")&&bodyString.endsWith("]")))) { continue; } //瑙f瀽瀹屾垚,topic鍙戦�佷竴娆� -- Gitblit v1.8.0