Commit 64c1f248 authored by martin hou's avatar martin hou

feat: 删除无用日志输出和增加HDPM写号支持

parent 00e8a809
...@@ -180,7 +180,7 @@ export function Home() { ...@@ -180,7 +180,7 @@ export function Home() {
const writeSN = async () => { const writeSN = async () => {
let nsn = prompt('请输入新的SN号', ''); let nsn = prompt('请输入新的SN号', '');
if (nsn && nsn.match(/^HD(H1|1E|P1)\w{9}$/gi)) if (nsn && nsn.match(/^HD(H1|1E|P1|PM)\w{9}$/gi))
{ {
let rst = await jensen.writeSerialNumber(nsn); let rst = await jensen.writeSerialNumber(nsn);
alert(rst.result); alert(rst.result);
...@@ -189,6 +189,10 @@ export function Home() { ...@@ -189,6 +189,10 @@ export function Home() {
const connectx = async () => { const connectx = async () => {
const usb = (navigator as any).usb; const usb = (navigator as any).usb;
usb.onconnect = (evt: any) => {
console.log(evt);
}
/*
usb.getDevices().then(async (devices: any[]) => { usb.getDevices().then(async (devices: any[]) => {
for (let i = 0; i < devices.length; i++) for (let i = 0; i < devices.length; i++)
{ {
...@@ -200,6 +204,7 @@ export function Home() { ...@@ -200,6 +204,7 @@ export function Home() {
console.log(rst); console.log(rst);
} }
}); });
*/
} }
return ( return (
......
...@@ -343,7 +343,7 @@ function Jensen(log, conn) { ...@@ -343,7 +343,7 @@ function Jensen(log, conn) {
const tryReceive = function () { const tryReceive = function () {
if (device) if (device)
console.log('trace', device); // console.log('trace', device);
device.transferIn(2, RECV_BUFF_SIZE).then((r) => { device.transferIn(2, RECV_BUFF_SIZE).then((r) => {
Logger.save?.('jensen', 'tryReceive', r?.data); Logger.save?.('jensen', 'tryReceive', r?.data);
// console.log('Receive', r?.data); // console.log('Receive', r?.data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment