feat(core): 支持通过web usb烧录固件

This commit is contained in:
王立帮
2025-10-24 16:07:57 +08:00
parent 42acf014f0
commit ed9a91afdc
10 changed files with 307 additions and 438 deletions

View File

@@ -121,6 +121,7 @@ class USBMini extends Serial {
#dataLength_ = 64;
constructor(port) {
super(port);
this.#device_ = USBMini.getPort(port);
}
#addEventsListener_() {
@@ -315,6 +316,14 @@ class USBMini extends Serial {
return this.setDTRAndRTS(this.getDTR(), rts);
}
getVID() {
return this.#device_.vendorId;
}
getPID() {
return this.#device_.productId;
}
onBuffer(buffer) {
super.onBuffer(buffer);
for (let i = 0; i < buffer.length; i++) {