Skip to content

Add: Add BLE device continuous scan feature for Android#15

Open
ShortArrow wants to merge 5 commits into26F-Studio:mainfrom
ShortArrow:develop
Open

Add: Add BLE device continuous scan feature for Android#15
ShortArrow wants to merge 5 commits into26F-Studio:mainfrom
ShortArrow:develop

Conversation

@ShortArrow
Copy link
Copy Markdown

Background

  • My app (iBeacon triangulation) requires continuous BLE device scanning to detect nearby beacons
  • The existing plugin had no scanning capability

Changes

  • Add start/stop commands for continuous BLE device scanning
  • Emit device discovery events with device info (name, address, RSSI, etc.)
  • Implement Android BLE scanning across Kotlin, Rust, and TypeScript layers
  • Add permission definitions for new scan commands

Scope

  • 12 files changed, +437 / -7 lines
  • Rust: src/commands.rs, src/mobile.rs, src/android_init.rs, src/bluetooth.rs, src/lib.rs, src/error.rs, src/models.rs
  • Android: android/src/main/java/ExamplePlugin.kt
  • JS: guest-js/index.ts, guest-js/types.ts
  • Config: Cargo.toml, permissions/default.toml

- Add UNKNOWN_TX_POWER_LEVEL constant to remove magic number -59
- Extract buildDeviceObject() to eliminate duplicated device JSObject construction
- Extract getRequiredPermissions() to eliminate duplicated permission arrays
@ShortArrow ShortArrow marked this pull request as ready for review March 26, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant