Advertise the Rust preview platform over BLE - #513
Merged
Conversation
- 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
marked this pull request as ready for review
August 6, 2026 02:05
Greptile SummaryThe PR adds the host platform to the Rust preview's BLE status payload while retaining the existing local name and protocol version.
Confidence Score: 5/5The 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.
|
| 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
Reviews (1): Last reviewed commit: "Advertise Rust preview platform" | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Android can now distinguish nearby Windows and macOS Rust-preview hosts without relying on platform-specific Bluetooth device names.
Compatibility
platformis additive and useswindowsormacos. Older Android clients ignore the extra JSON field, and the shipping C# implementation is unchanged.Test plan
npm run lintnpm testnpm run buildcargo fmt --manifest-path src-tauri/Cargo.toml --checkcargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warningscargo test --locked --manifest-path src-tauri/Cargo.tomlCoordination
Android consumer: switchifyapp/switchify-android#2767
Closes #512