From dcbcf9d1adbc95b2567094e4e61f68b3d70cdd37 Mon Sep 17 00:00:00 2001 From: lixiao <932184220@qq.com> Date: Mon, 17 Feb 2025 10:30:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96udp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/utils/GlobalUdp.ts | 4 ++++ entry/src/main/ets/utils/UdpUtils.ets | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/entry/src/main/ets/common/utils/GlobalUdp.ts b/entry/src/main/ets/common/utils/GlobalUdp.ts index d0223864..75a8ec18 100644 --- a/entry/src/main/ets/common/utils/GlobalUdp.ts +++ b/entry/src/main/ets/common/utils/GlobalUdp.ts @@ -10,6 +10,7 @@ export async function sendMsg(val) { // globalThis.udpClient1&&globalThis.udpClient1.sendMsg(val) } +// obj export async function getUDP(context, errorFlag?) { return new Promise(async (reslove, reject) => { const fileUtil = new FileUtil(context) @@ -76,6 +77,7 @@ export async function getUDP(context, errorFlag?) { } +// 中心 export async function getUDP2(context, errorFlag?) { const fileUtil = new FileUtil(context) const carInfo=AppStorage.get('carInfo') @@ -159,6 +161,7 @@ export async function getUDP2(context, errorFlag?) { } +// 灯光 export async function setTopLineUdp() { const context=AppStorage.get('context') const fileUtil = new FileUtil(context) @@ -181,6 +184,7 @@ export async function setTopLineUdp() { // let judgeUdpTimer +// 评判 export async function setJudgeUdp() { const context=AppStorage.get('context') const fileUtil = new FileUtil(context) diff --git a/entry/src/main/ets/utils/UdpUtils.ets b/entry/src/main/ets/utils/UdpUtils.ets index ec48e71b..c0279966 100644 --- a/entry/src/main/ets/utils/UdpUtils.ets +++ b/entry/src/main/ets/utils/UdpUtils.ets @@ -72,4 +72,10 @@ class UdpClient { } } -export const udpClient = new UdpClient() \ No newline at end of file +export const objUDPClient = new UdpClient() + +export const centerUDPClient = new UdpClient() + +export const lightUDPClient = new UdpClient() + +export const judgeUDPClient = new UdpClient()