From 3fade2df2435acd53df909facaece5d91f964688 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Mon, 21 Oct 2024 09:34:27 +0800 Subject: [PATCH] =?UTF-8?q?tcp=20carno=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/utils/GlobalTcp.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entry/src/main/ets/common/utils/GlobalTcp.ts b/entry/src/main/ets/common/utils/GlobalTcp.ts index 5cf440f1..acc5a373 100644 --- a/entry/src/main/ets/common/utils/GlobalTcp.ts +++ b/entry/src/main/ets/common/utils/GlobalTcp.ts @@ -19,7 +19,7 @@ export async function getTCP() { setTimeout(async () => { await globalThis.TcpClient.rebindTcp(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort) await globalThis.TcpClient.connectTcp() - await globalThis.TcpClient.sendMsg('1002') //1002 + await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 globalThis.TcpClient.onError((val) => { setTimeout(() => { getTCP() @@ -27,7 +27,7 @@ export async function getTCP() { }) await globalThis.TcpClient.onMessage((val) => { setTimeout(() => { - globalThis.TcpClient.sendMsg('1002') //1002 + globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 if (val) { // const msg=val.substring(5,val.length-1) console.log('socketTag[PLC.UdpClient] status:', globalThis.udpClient.getStatus()) @@ -45,7 +45,7 @@ export async function getTCP() { globalThis.TcpClient = tcpClient await globalThis.TcpClient.bindTcp() await globalThis.TcpClient.connectTcp() - await globalThis.TcpClient.sendMsg('1002') //1002 + await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 globalThis.TcpClient.onError((val) => { setTimeout(() => { getTCP() @@ -54,7 +54,7 @@ export async function getTCP() { await globalThis.TcpClient.onMessage((val) => { hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val)); setTimeout(() => { - globalThis.TcpClient.sendMsg('1002') //1002 + globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 if (val && globalThis.udpClient?.sendMsg) { globalThis.udpClient?.sendMsg(val) }