feat: Enhance PropertyPanel, add RFID auto-gen, and fix node connections
This commit is contained in:
@@ -45,9 +45,9 @@ export class SerialPortHandler {
|
||||
if (this.port.readable) {
|
||||
this.reader = this.port.readable.getReader();
|
||||
}
|
||||
|
||||
|
||||
if (this.port.writable) {
|
||||
this.writer = this.port.writable.getWriter();
|
||||
this.writer = this.port.writable.getWriter();
|
||||
}
|
||||
|
||||
this.isConnected = true;
|
||||
@@ -86,19 +86,24 @@ export class SerialPortHandler {
|
||||
} else {
|
||||
payload = data;
|
||||
}
|
||||
await this.writer.write(payload);
|
||||
try {
|
||||
await this.writer.write(payload);
|
||||
} catch (e) {
|
||||
console.error("Serial Send Error", e);
|
||||
throw e; // Re-throw to let caller know if needed, or handle gracefull
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getPortInfo(): string | null {
|
||||
if (this.port) {
|
||||
const info = this.port.getInfo();
|
||||
if (info.usbVendorId && info.usbProductId) {
|
||||
return `ID:${info.usbVendorId.toString(16).padStart(4,'0').toUpperCase()}:${info.usbProductId.toString(16).padStart(4,'0').toUpperCase()}`;
|
||||
}
|
||||
return "USB Device";
|
||||
if (this.port) {
|
||||
const info = this.port.getInfo();
|
||||
if (info.usbVendorId && info.usbProductId) {
|
||||
return `ID:${info.usbVendorId.toString(16).padStart(4, '0').toUpperCase()}:${info.usbProductId.toString(16).padStart(4, '0').toUpperCase()}`;
|
||||
}
|
||||
return null;
|
||||
return "USB Device";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private async readLoop() {
|
||||
|
||||
Reference in New Issue
Block a user