feat(core): web usb mini下增加对DTR/RTS控制的支持

This commit is contained in:
王立帮
2025-10-23 13:36:50 +08:00
parent e47f2f7026
commit 7b15abef9c

View File

@@ -295,6 +295,15 @@ class USBMini extends Serial {
|| (this.getDTR() === dtr && this.getRTS() === rts)) { || (this.getDTR() === dtr && this.getRTS() === rts)) {
return; return;
} }
if (this.#ctrlInterfaceNumber_ !== -1) {
await this.#device_.controlTransferOut({
requestType: 'class',
recipient: 'interface',
request: 0x22,
value: dtr | (rts << 1),
index: this.#ctrlInterfaceNumber_
});
}
await super.setDTRAndRTS(dtr, rts); await super.setDTRAndRTS(dtr, rts);
} }