Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions components/odrive_ascii/web/odrive_control_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,13 @@ <h2>Device</h2>

async function connect() {
try {
// `{ filters: [] }` is not a valid "any device" request in Chromium's
// WebUSB; use the explicit `acceptAllDevices` flag for that path.
// WebUSB has no `acceptAllDevices` option (that is Web Bluetooth) --
// `filters` is a required member, and a single empty filter object `{}`
// matches every device. The default filter is VID-only so any espp
// device (VID 0x1209) is offered, not just the ODrive PID.
const options = els.anyDevice.checked
? { acceptAllDevices: true }
: { filters: [{ vendorId: DEFAULT_VID, productId: DEFAULT_PID }] };
? { filters: [{}] }
: { filters: [{ vendorId: DEFAULT_VID }] };
device = await navigator.usb.requestDevice(options);
} catch (e) {
// Only NotFoundError is a user cancel / no-match; anything else is real.
Expand Down Expand Up @@ -1455,7 +1457,7 @@ <h2>Device</h2>
setStatus("", "Disconnected");
setConnectedUI(false);
logLine("sys", "Ready. Click Connect and pick the ODrive native (vendor) USB device.");
logLine("sys", `Default filter: VID 0x${DEFAULT_VID.toString(16)} / PID 0x${DEFAULT_PID.toString(16)}. Tick "Any device" to see all.`);
logLine("sys", `Default filter: any espp device (VID 0x${DEFAULT_VID.toString(16)}). Tick "Any device" to see all.`);
Comment on lines 1459 to +1460
logLine("sys", "This panel speaks the native (Fibre-endpoint) BINARY protocol, not ASCII.");
drawPlot(); updateLegend();
}
Expand Down
13 changes: 7 additions & 6 deletions components/odrive_ascii/web/odrive_webusb_console.html
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,13 @@ <h2>Misc</h2>
// 1) Ask the user to pick a device. Default filter targets the espp
// ODrive vendor VID/PID; "Any device" shows every device instead.
Comment on lines 674 to 675
try {
// Note: `{ filters: [] }` is NOT a valid "show all devices" request in
// Chromium's WebUSB (it requires at least one filter or the explicit
// `acceptAllDevices` flag). Use `acceptAllDevices: true` for that path.
// WebUSB has no `acceptAllDevices` option (that is Web Bluetooth) --
// `filters` is a required member, and a single empty filter object `{}`
// matches every device. The default filter is VID-only so any espp
// device (VID 0x1209) is offered, not just the ODrive PID.
const options = els.anyDevice.checked
? { acceptAllDevices: true }
: { filters: [{ vendorId: DEFAULT_VID, productId: DEFAULT_PID }] };
? { filters: [{}] }
: { filters: [{ vendorId: DEFAULT_VID }] };
device = await navigator.usb.requestDevice(options);
} catch (e) {
// Only a NotFoundError means the user dismissed the chooser (or nothing
Expand Down Expand Up @@ -1184,7 +1185,7 @@ <h2>Misc</h2>
setStatus("", "Disconnected");
setConnectedUI(false);
logLine("sys", "Ready. Click Connect and pick the ODrive vendor USB device.");
logLine("sys", `Default filter: VID 0x${DEFAULT_VID.toString(16)} / PID 0x${DEFAULT_PID.toString(16)}. Tick "Any device" to see all.`);
logLine("sys", `Default filter: any espp device (VID 0x${DEFAULT_VID.toString(16)}). Tick "Any device" to see all.`);
Comment on lines 1187 to +1188
drawSpark();
}

Expand Down
Loading