diff --git a/entry/oh-package-lock.json5 b/entry/oh-package-lock.json5 index 1f023b33..bc40219d 100644 --- a/entry/oh-package-lock.json5 +++ b/entry/oh-package-lock.json5 @@ -1,15 +1,13 @@ { - "lockfileVersion": 2, + "lockfileVersion": 1, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "specifiers": { "@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6" }, "packages": { "@ohos/hypium@1.0.6": { - "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", - "integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==", - "registryType": "ohpm", - "shasum": "3f5fed65372633233264b3447705b0831dfe7ea1" + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", + "integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==" } } } \ No newline at end of file diff --git a/entry/src/main/ets/common/service/indexService.ts b/entry/src/main/ets/common/service/indexService.ts index e2f937e3..f87bf8f9 100644 --- a/entry/src/main/ets/common/service/indexService.ts +++ b/entry/src/main/ets/common/service/indexService.ts @@ -7,12 +7,14 @@ import { takePhoto, deleteAllFileByPiC } from '../../common/service/videoService // import { VideoConfigData } from '../../mock'; import request from '@ohos.request' import Prompt from '@system.prompt'; +import util from '@ohos.util'; import { delSyncTable, getDataBaseTable, getMySystemSetTable, upDataZhongxinginitialization, + getSyncData, upDateTable } from '../../common/service/initable' import { GlobalConfig } from '../../config/index' @@ -455,9 +457,9 @@ function getChuankouFnMsg() { let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE testNapi.SerialSendAsync(globalThis.fd, databuff, (ret) => { testNapi.SerialRecvAsync(globalThis.fd, timeout, (revTestInfo) => { - const message = revTestInfo?.recevedBuf?.toString() - if (message == '') { + let msgBuf = util.TextDecoder.create().decodeWithStream(new Uint8Array(revTestInfo?.recevedBuf)) + if (message == '' || msgBuf == '') { globalThis.num = 1 // clearInterval(chuankou) testNapi.SerialClose(globalThis.fd); @@ -468,16 +470,8 @@ function getChuankouFnMsg() { return } const msg = message?.split(',') - if (!msg?.length) { - - } else if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) { - - } else if (msg.length < 12) { - - } else { - globalThis.chuankoMsg = msg[9] - } - + let dang = Number(msgBuf?.split(",")?.[1]?.split('\r')[0] || 0) + globalThis.chuankoMsg =( msg[9] === '' || msg[9] >10 ) ? dang: msg[9] setTimeout(() => { getChuankouFnMsg() }, 500)