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