feat:usb调试
This commit is contained in:
parent
489b470e83
commit
24101f5366
@ -25,10 +25,10 @@ function plcStrToWXCodeArr(wuXiDataStr){
|
|||||||
//补齐0x00
|
//补齐0x00
|
||||||
if(oSize > 0){
|
if(oSize > 0){
|
||||||
let oSizeArr = []
|
let oSizeArr = []
|
||||||
for(let j = 0;j < oSize;j++){oSizeArr.push(0)}
|
for(let j = 0;j < oSize;j++){oSizeArr.push(0x00)}
|
||||||
// packetArr.push([0,thisPacket.length].concat(thisPacket).concat(oSizeArr));
|
packetArr.push([0x00,thisPacket.length].concat(thisPacket).concat(oSizeArr));
|
||||||
}else{
|
}else{
|
||||||
packetArr.push([thisPacket.length].concat(thisPacket));
|
packetArr.push([0x00,thisPacket.length].concat(thisPacket));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return packetArr
|
return packetArr
|
||||||
@ -65,10 +65,10 @@ const initUsbServicesFn = () => {
|
|||||||
const codeArr = plcStrToWXCodeArr(wuXiDataStr);
|
const codeArr = plcStrToWXCodeArr(wuXiDataStr);
|
||||||
// console.info(LOGTAG,firstArr)
|
// console.info(LOGTAG,firstArr)
|
||||||
// console.info(LOGTAG,secondArr)
|
// console.info(LOGTAG,secondArr)
|
||||||
|
|
||||||
for(let i = 0; i < codeArr.length;i++){
|
for(let i = 0; i < codeArr.length;i++){
|
||||||
try {
|
try {
|
||||||
console.info(LOGTAG,codeArr[i])
|
// const e = await usb.bulkTransfer(devicepipe, inEndpoint, new Uint8Array(codeArr[i]))
|
||||||
|
// console.info(LOGTAG,e)
|
||||||
const f = await usb.bulkTransfer(devicepipe, outEndpoint, new Uint8Array(codeArr[i]))
|
const f = await usb.bulkTransfer(devicepipe, outEndpoint, new Uint8Array(codeArr[i]))
|
||||||
console.info(LOGTAG,f)
|
console.info(LOGTAG,f)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export const judgeConfig = {
|
|||||||
//科目二
|
//科目二
|
||||||
// trajectoryPath: 'logs/wu_xi_km2/0000000000001_342323199501470011_测试学员1_1970_01_01_08_39_35/judge_exam_data.txt',
|
// trajectoryPath: 'logs/wu_xi_km2/0000000000001_342323199501470011_测试学员1_1970_01_01_08_39_35/judge_exam_data.txt',
|
||||||
//科目三
|
//科目三
|
||||||
trajectoryPath: 'logs/wu_xi_km3/0000000000001_342323199501470011_测试学员1_2024_05_15_11_43_45/judge_exam_data.txt'
|
trajectoryPath: 'logs/0000000000001_342323199501470011_测试学员1_1970_01_01_08_32_05/judge_exam_data.txt'
|
||||||
}
|
}
|
||||||
|
|
||||||
//0000000000001_342323199501470011_测试学员1_2024_04_28_10_59_44
|
//0000000000001_342323199501470011_测试学员1_2024_04_28_10_59_44
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user