feat(core): 支持通过web usb烧录固件
This commit is contained in:
@@ -108,6 +108,7 @@ class WebSerialPort extends Serial {
|
||||
#stringTemp_ = '';
|
||||
constructor(port) {
|
||||
super(port);
|
||||
this.#serialport_ = WebSerialPort.getPort(port);
|
||||
}
|
||||
|
||||
#addEventsListener_() {
|
||||
@@ -230,6 +231,16 @@ class WebSerialPort extends Serial {
|
||||
return this.setDTRAndRTS(this.getDTR(), rts);
|
||||
}
|
||||
|
||||
getVID() {
|
||||
const info = this.#serialport_.getInfo();
|
||||
return info.usbVendorId;
|
||||
}
|
||||
|
||||
getPID() {
|
||||
const info = this.#serialport_.getInfo();
|
||||
return info.usbProductId;
|
||||
}
|
||||
|
||||
onBuffer(buffer) {
|
||||
super.onBuffer(buffer);
|
||||
for (let i = 0; i < buffer.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user