PROTOCOL NOTES / 12
20 · Apple and Android bridged over BLE with mixing
Participants: iPad, Pixel, Peer
Implemented software · Tested on hosts and emulators only · Physical qualification pending
Starting state
Sealed ride. iPad (roster index 0, Apple, BLE link capable, no Wi-Fi Aware pairing with the others) is its own root. Pixel (no NAN Pairing, BLE host capable) and Peer are linked over Wi-Fi Aware with root 1. Pixel advertises the ride service UUID and serves the encrypted GATT ride information.
Ordered events
- Pixel → iPad
Connectable BLE advertising with the ride service UUID
- iPad → Pixel
GATT read of the encrypted ride information, decrypted with the ride-token key, advertisement verified before the PSM is used
- iPad → iPad
Pixel advertises a greater root, so after a random 0-2 s delay with the roots still different the central decides to link
- iPad → Pixel
Open the L2CAP channel on the GATT connection without pairing, ClientHello within 1 s, TLS in stream frames, greeting linkKind ble mediaPort 0
- Pixel → iPad
hello, advert, state synchronization and mix descriptors with kind mix and edge, created at link verification
- Pixel → iPad
handoff_prepare as child and probes in datagram frames, iPad answers handoff_ready, Pixel activates and iPad acknowledges
- Pixel → Pixel
Mix its own microphone through the five-frame delay line and the Peer voice from playback PCM, Opus 32 kbit/s with speaker set and mixer set
- Pixel → iPad
Mix frames in datagram frames under the combined BLE window, heartbeats only on change or every 3 s, no source_status, only Pixel's own feedback
- iPad → Pixel
iPad mix, and acks within 20 ms or after 1,024 bytes
- Pixel → Peer
Forward the iPad mix unchanged over Wi-Fi Aware
Fields and messages
Ride service UUID 6B1E0000-7C3A-4E55-9D2E- plus six tag bytes; GATT ride information: nonce, AES-128-GCM of the PSM (2 bytes big-endian) and the advertisement, tag; frame length, kind and body; ack uint64 cumulative bytes of stream and datagram frames, headers included; stream descriptor kind and edge; 4-byte mix header with speaker set and mixer set.
Authorization and invariants
Apple-as-central rule; the ride information decrypts and the advertisement passes the structural checks before the PSM is used; BLE adjacent cost max(600, C_adj + 400); no individual voice crosses the BLE edge; the mix toward a neighbor excludes its voice, frames received over the edge and mix frames whose speaker set contains it or whose mixer set contains either bridge; a receiver discards a mix frame whose speaker set contains its own index; duplicates removed by source replay before mixing; the mixer never blocks playback; feedback, source status and heartbeats crossing the edge are filtered.
Timers
Merge delay 0-2 s; L2CAP open 5 s, ClientHello 1 s, TLS and greeting 5 s, hello 5 s; window max(1,536 bytes, 100 ms of the delivery rate) over stream and datagram frames, stream frames up to 1,024 bytes beyond it; BLE egress deadline 100 ms in the outbox and again in the channel queue, media age 180 ms when a bundle is built; ack within 20 ms or after 1,024 bytes; heartbeat across the edge on change or at most every 3 s per source; mixer on a 20 ms cadence; an idle BLE link is closed by the central after 10 s and by the host after 20 s.
Resource lifetime
One mix source per (bridge, BLE neighbor) for the ride, reused if the link forms again; channel, TLS and hop keys per connection; voice keys, SSRCs and replay unchanged.
What the rider sees
Diagnostics show link kind ble, peer platform, window, in-flight bytes, delivery rate, TTL drops, filtered control and the mix role; riders beyond the bridge see speaking indicators from the mix speaker set.
Failure branches
Channel loss or a framing error is a hard loss followed by scoped repair; the central retries after 1, 2, 4 then 5 s; a host whose ride information fails decryption or verification is ignored for 60 s; a channel without a ClientHello within 1 s is closed with peer cooldown; a full window delays and then drops media with counted TTL drops while control continues; a stream backlog above 32,768 bytes closes the link; a late mixer drops its own frames.
Resulting state
One BLE edge joins iPad and Pixel; Pixel is iPad's child; each side sends one mixed stream over the edge; Peer receives the iPad mix through Pixel over Wi-Fi Aware; flooded control crossing the edge is filtered.
Evidence boundary
Implemented software; host, Swift package, JVM and emulator tests only. Host tests cover channel framing, the window, acks and deadlines over a throttled in-memory pipe, TLS and the greeting over BLE frames with duplex audio, the C interface Swift uses, encrypted ride information with the Apple device as central, and four engines with one mix per direction across a BLE edge. An Android instrumentation probe admitted a rider between two emulators over BLE. Spike throughput and mixing cost are not qualification; no Android to Apple BLE link has run between physical phones, and range and headset-call coexistence are unqualified.
Authority: RWCP v2 reviewed scenario catalogue, scenario 20. Public examples are synthetic. This guide is maintained against the private implementation; it does not imply access to its source.