diff --git a/entry/src/main/ets/tcp2byte/index.ts b/entry/src/main/ets/tcp2byte/index.ts index eb5f2dc5..b5e11e85 100644 --- a/entry/src/main/ets/tcp2byte/index.ts +++ b/entry/src/main/ets/tcp2byte/index.ts @@ -94,8 +94,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(rData[i]); + } //返回的消息类型 const messageType = receiveData[1]; //流水号