feat: add Android USB serial port support via USB Host API

- Add USB Host permissions and device filter to AndroidManifest.xml
- Create UsbSerialPlugin Kotlin plugin for USB Host API (enumerate, permission, open devices)
- Add serial_connect_fd command for Android to accept USB file descriptors
- Create RawFdStream wrapper for async I/O on raw file descriptors
- Make run_serial_with_poll generic over AsyncRead+AsyncWrite
- Register UsbSerialPlugin in MainActivity
This commit is contained in:
lenn
2026-05-11 20:31:46 +08:00
parent 7323021aec
commit 551022215c
13 changed files with 535 additions and 16 deletions

View File

@@ -53,6 +53,8 @@ uuid = { version = "1", features = ["v4", "serde"] }
rand = "0.8"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
ndarray = { version = "0.15", optional = true }
[target.'cfg(target_os = "android")'.dependencies]
libc = "0.2"
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-updater = "2"