Skip to content

Commit

Permalink
port our vid/pid parsing from the old electron way to what WebSerial …
Browse files Browse the repository at this point in the history
…does
  • Loading branch information
obra committed Feb 6, 2024
1 parent 6b903a1 commit 01e8327
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/api/focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class Focus {
});

for (const port of portList) {
const pid = parseInt("0x" + port.productId),
vid = parseInt("0x" + port.vendorId);
const pid = port.productId;
const vid = port.vendorId;

if (pid == usbInfo.productId && vid == usbInfo.vendorId) {
const newPort = Object.assign({}, port);
Expand Down Expand Up @@ -223,8 +223,8 @@ class Focus {

for (const port of portList) {
for (const device_descriptor of device_descriptors) {
const pid = parseInt("0x" + port.productId),
vid = parseInt("0x" + port.vendorId);
const pid = port.productId;
const vid = port.vendorId;

if (pid == device_descriptor.usb.productId && vid == device_descriptor.usb.vendorId) {
const newPort = Object.assign({}, port);
Expand Down

0 comments on commit 01e8327

Please sign in to comment.