diff --git a/entry/src/main/ets/tcp2byte/index.ts b/entry/src/main/ets/tcp2byte/index.ts index bbc4dcc4..aefff462 100644 --- a/entry/src/main/ets/tcp2byte/index.ts +++ b/entry/src/main/ets/tcp2byte/index.ts @@ -114,8 +114,8 @@ function handReceiveMessage(client: socket.TCPSocket, sendData, rData: ArrayBuff const start = index * 2; const end = start + 1; const packageIndex = bytesToDecimal([packages[start],packages[end]]); - console.info(TAG, '补包内容' + JSON.stringify(new Uint8Array(sendData[packageIndex]))) - client.send({data:new Uint8Array(sendData[packageIndex]).buffer}); + console.info(TAG, '补包内容' + JSON.stringify(new Uint8Array(sendData[packageIndex-1]))) + client.send({data:new Uint8Array(sendData[packageIndex-1]).buffer}); }) } else { const decoder = util.TextDecoder.create('utf-8');