feat(core): 支持通过web usb烧录固件
This commit is contained in:
@@ -117,6 +117,7 @@ class USB extends Serial {
|
||||
#stringTemp_ = '';
|
||||
constructor(port) {
|
||||
super(port);
|
||||
this.#device_ = USB.getPort(port);
|
||||
}
|
||||
|
||||
#addEventsListener_() {
|
||||
@@ -223,6 +224,14 @@ class USB 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