【发布时间】:2020-07-22 08:01:33
【问题描述】:
我正在使用 Web Serial API 连接两个不同的秤。他们以不同的方式发送重量数据,所以我试图从他们那里获取串行端口元数据(vendorId 等),因为我想检测连接了哪个秤。 “getInfo()”方法不起作用,因为它在 Serialport 对象中未定义。
[Exposed=(DedicatedWorker,Window), SecureContext]
interface SerialPortInfo {
maplike<DOMString, DOMString?>;
};
这是元数据的接口,但我什至不知道如何使用它。
【问题讨论】:
标签: google-chrome serial-port webusb