diff --git a/entry/src/main/ets/common/service/indexService.ts b/entry/src/main/ets/common/service/indexService.ts index 5934d8d1..0aa2410d 100644 --- a/entry/src/main/ets/common/service/indexService.ts +++ b/entry/src/main/ets/common/service/indexService.ts @@ -435,15 +435,17 @@ const devPath = "/dev/ttyS3" function openChuankouFn(callback) { console.log('SerialOpen in indexservice, path=' + devPath) - //TODO 自动挡车不读取串口 - 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() + //自动挡车不读取串口 + 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() + }); }); - }); + } } function getChuankouFnMsg() { diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index a2e0505e..9a81e43b 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -677,6 +677,11 @@ struct Index { }, 1000) this.createAlbum() + getSyncData('ES_CARINFO').then(result => { + const carInfo = result[0] || {}; + globalThis.carInfo.kscx = carInfo.kscx + }) + // clearInterval(globalThis.demo) // globalThis.demo= setInterval(()=>{ // const str= {"carId":"1062","examinationRoomId":"2","videoVersion":"1.0","judgeVersion":"2023.09.30.1","shellVersion":"2023.12.13.01","host":"http://172.37.55.191:8082"}