feat(core): 支持通过web usb烧录固件
This commit is contained in:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user