Skip to content

Commit

Permalink
feat: android support
Browse files Browse the repository at this point in the history
  • Loading branch information
Theaninova committed Nov 23, 2024
1 parent f3704e4 commit fb8efc4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"vite-plugin-mkcert": "^1.17.6",
"vite-plugin-pwa": "^0.20.5",
"vitest": "^2.1.4",
"web-serial-polyfill": "^1.0.15",
"workbox-window": "^7.3.0"
},
"type": "module"
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/lib/serial/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ if (
await import("./tauri-serial");
}

if (browser && navigator.serial === undefined && navigator.usb !== undefined) {
await import("web-serial-polyfill");
}

export async function getViablePorts(): Promise<SerialPort[]> {
return navigator.serial.getPorts().then((ports) =>
ports.filter((it) => {
Expand Down

0 comments on commit fb8efc4

Please sign in to comment.