From 4d0e35c8f0f8131f58dd6221419d85804693a761 Mon Sep 17 00:00:00 2001 From: surenjun Date: Wed, 5 Mar 2025 10:06:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/tcp2byte/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/entry/src/main/ets/tcp2byte/index.ts b/entry/src/main/ets/tcp2byte/index.ts index a7531259..032f0474 100644 --- a/entry/src/main/ets/tcp2byte/index.ts +++ b/entry/src/main/ets/tcp2byte/index.ts @@ -88,8 +88,12 @@ function handSendMessage(client: socket.TCPSocket, type, data) { } //处理接收的数据 -function handReceiveMessage(client: socket.TCPSocket, sendData, receiveData):RES { - console.info(TAG, 'receiveData=>' + JSON.stringify(receiveData)) +function handReceiveMessage(client: socket.TCPSocket, sendData, rData):RES { + console.info(TAG, 'receiveData=>' + rData) + let receiveData = [] + for (let i = 0; i < rData.length; i++) { + receiveData.push(buffer[i]); + } //返回的消息类型 const messageType = receiveData[1]; //流水号