From 448a16fab9e4bf6b6849d9400c5e821ef591b64d Mon Sep 17 00:00:00 2001 From: surenjun Date: Sat, 28 Jun 2025 09:54:28 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20=E6=A1=A3=E4=BD=8D=E4=B8=B2?= =?UTF-8?q?=E5=8F=A3=E8=AF=BB=E5=8F=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/common/service/indexService.ts | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/entry/src/main/ets/common/service/indexService.ts b/entry/src/main/ets/common/service/indexService.ts index 0aa2410d..e2f937e3 100644 --- a/entry/src/main/ets/common/service/indexService.ts +++ b/entry/src/main/ets/common/service/indexService.ts @@ -433,19 +433,21 @@ let fd const devPath = "/dev/ttyS3" function openChuankouFn(callback) { - console.log('SerialOpen in indexservice, path=' + devPath) - - //自动挡车不读取串口 - if(globalThis.carInfo && globalThis.carInfo.kscx == 'C1'){ - testNapi.SerialOpenAsync(devPath, (fd) => { - globalThis.fd = fd; - globalThis.num = 0 - let parity = 0x4e; // 'N' - let ret = testNapi.SerialSetAsync(globalThis.fd, 115200, 0, 8, 1, parity, (ret) => { - callback() + getSyncData('ES_CARINFO').then(result => { + const carInfo = result[0] || {}; + globalThis.carInfo.kscx = carInfo.kscx + console.info('srj ES_CARINFO=>',JSON.stringify(carInfo)) + if(carInfo.kscx == 'C1'){ + testNapi.SerialOpenAsync(devPath, (fd) => { + globalThis.fd = fd; + globalThis.num = 0 + let parity = 0x4e; // 'N' + let ret = testNapi.SerialSetAsync(globalThis.fd, 115200, 0, 8, 1, parity, (ret) => { + callback() + }); }); - }); - } + } + }) } function getChuankouFnMsg() {