新旧档位
This commit is contained in:
parent
c45de7c1bd
commit
3ecd0a2ef1
Binary file not shown.
@ -301,16 +301,17 @@ function openChuankouFn(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getChuankouFnMsg() {
|
function getChuankouFnMsg() {
|
||||||
testNapi.SerialRecvAsync(globalThis.fd, 5000, (revTestInfo) => {
|
// 新档位
|
||||||
const message = revTestInfo?.recevedBuf?.toString()
|
// testNapi.SerialRecvAsync(globalThis.fd, 5000, (revTestInfo) => {
|
||||||
let msg = util.TextDecoder.create().decodeWithStream(new Uint8Array(revTestInfo?.recevedBuf))
|
// const message = revTestInfo?.recevedBuf?.toString()
|
||||||
let dang = Number(msg?.split(",")?.[1] || 0)
|
// let msg = util.TextDecoder.create().decodeWithStream(new Uint8Array(revTestInfo?.recevedBuf))
|
||||||
globalThis.chuankoMsg = dang
|
// let dang = Number(msg?.split(",")?.[1] || 0)
|
||||||
console.log("lixiao, chuankou", msg)
|
// globalThis.chuankoMsg = dang
|
||||||
})
|
// console.log("lixiao, chuankou", msg)
|
||||||
setTimeout(() => {
|
// })
|
||||||
getChuankouFnMsg()
|
// setTimeout(() => {
|
||||||
}, 200)
|
// getChuankouFnMsg()
|
||||||
|
// }, 200)
|
||||||
let timeout = 50000; // 2秒超时
|
let timeout = 50000; // 2秒超时
|
||||||
let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE
|
let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE
|
||||||
testNapi.SerialSendAsync(globalThis.fd, databuff, (ret) => {
|
testNapi.SerialSendAsync(globalThis.fd, databuff, (ret) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user