Skip to content

Advertise the Rust preview platform over BLE - #513

Merged
enaboapps merged 1 commit into
mainfrom
feat/platform-advertisement-512
Aug 6, 2026
Merged

Advertise the Rust preview platform over BLE#513
enaboapps merged 1 commit into
mainfrom
feat/platform-advertisement-512

Conversation

@enaboapps

Copy link
Copy Markdown
Contributor

Summary

  • add the host platform to the shared BLE status payload
  • reuse one serializer from the Rust Windows and macOS GATT implementations
  • keep the BLE local name and protocol version unchanged

Why

Android can now distinguish nearby Windows and macOS Rust-preview hosts without relying on platform-specific Bluetooth device names.

Compatibility

platform is additive and uses windows or macos. Older Android clients ignore the extra JSON field, and the shipping C# implementation is unchanged.

Test plan

  • npm run lint
  • npm test
  • npm run build
  • cargo fmt --manifest-path src-tauri/Cargo.toml --check
  • cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo test --locked --manifest-path src-tauri/Cargo.toml

Coordination

Android consumer: switchifyapp/switchify-android#2767

Closes #512

- Serialize the host platform in the shared BLE status payload
- Reuse the status contract across Windows and macOS runtimes
- Keep protocol version 1 and cover both platform values

🤖 Auto-generated
@enaboapps
enaboapps marked this pull request as ready for review August 6, 2026 02:05
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds the host platform to the Rust preview's BLE status payload while retaining the existing local name and protocol version.

  • Introduces a shared serializer for the BLE status payload.
  • Advertises stable windows and macos platform values.
  • Reuses the serializer in both Windows and macOS GATT implementations.
  • Adds serialization coverage for both supported platform values.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified in the changed BLE status path.

The serializer preserves all existing status fields and protocol metadata, adds the stable target-derived platform value, and is integrated compatibly into both platform-specific GATT implementations.

Important Files Changed

Filename Overview
cross-platform/src-tauri/src/protocol.rs Adds a typed shared BLE status serializer and tests that both supported platforms are included without changing the protocol version.
cross-platform/src-tauri/src/macos.rs Replaces inline status JSON construction with the shared serializer and sources the immutable macOS platform capability.
cross-platform/src-tauri/src/windows_runtime.rs Uses the shared serializer for status reads and includes the Windows platform capability in each response.

Sequence Diagram

sequenceDiagram
    participant Android
    participant GATT as Rust BLE GATT
    participant Serializer as bluetooth_status_payload
    participant State as Shared app state
    Android->>GATT: Read status characteristic
    GATT->>State: Read desktop ID and platform
    GATT->>Serializer: Serialize name, ID, platform, protocol version
    Serializer-->>GATT: JSON bytes
    GATT-->>Android: BLE status payload
Loading

Reviews (1): Last reviewed commit: "Advertise Rust preview platform" | Re-trigger Greptile

@enaboapps
enaboapps merged commit 20f6798 into main Aug 6, 2026
5 checks passed
@enaboapps
enaboapps deleted the feat/platform-advertisement-512 branch August 6, 2026 02:54
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.

Advertise the Rust preview platform over BLE

2 participants