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