Repository navigation
feat(settings): find and pair RNodes instead of typing ble:// - #5
Merged
Merged
Conversation
Derive an RNode's connection type from its saved value, tell a device id from a device name by format, and keep the chosen device's name and whether Starling paired it in two optional fields appended to the interface record. Older six-field records still load. A name saved by an older version is upgraded to the device id after a successful connection. A bare ble:// is never pinned to a device.
Covers prefix-derived connection types, id and name detection, the legacy-name upgrade, persistence with and without the appended fields, scan-row sorting, de-duplication and freezing, signal labels and the validation and picker messages.
Replace the free-text connection field with Connect over choices: Bluetooth or Wi-Fi on phones, Serial port or Wi-Fi on desktop. A Bluetooth RNode is chosen from a search dialog that also walks through pairing; the card shows the chosen device with Change and Forget. The editor is read-only while the node is running or starting. A Bluetooth RNode is shown by name in status and diagnostics.
Search for devices advertising the Nordic UART service, report why a search cannot run (permission, Bluetooth off, Location off on Android 11 and older) and hold back search starts before Android throttles them. Pair with createBond and follow ACTION_BOND_STATE_CHANGED. A device that Android knows as dual-mode or classic is paired from an LE connection instead, since createBond cannot name a transport. Permission requests now report granted, denied or permanently denied.
With a saved device address the bridge connects directly instead of scanning, and reconnects the same way. A pairing Starling created that has since been removed fails the start before connecting, and GATT authentication failures are reported as a missing pairing. Saved names and a bare ble:// keep the scan path. The service reports the connected device so a saved name can be upgraded to its address.
Add a CoreBluetooth scanner that reports signal strength and makes a trial connection to the picked RNode: subscribing to the UART service is when iOS pairs if the RNode requires it. The peripheral identifier is saved and the bridge connects through retrievePeripherals, scanning only to find the same identifier again. The Swift sources have not been compiled; the Kotlin side builds for iosArm64.
- Tell same-name RNodes apart by the last two bytes of their id, written
like the end of a Bluetooth address (77:10).
- Show "Choose an RNode..." in the card only after a start was tried
without one, not as soon as the card is empty.
- Title the pairing steps "Pair with {name}".
- Show "Not paired" and "Forget" in the muted colour; pairing is
optional, so neither is an error.
- Stack the buttons of the failed-pairing step so they fit narrow
screens and large fonts.
- Keep each example serial port path on one line.
List only devices named like an RNode in the search dialog, on Android and iOS; other radios offer the same UART service. Replace the pairing failure message that showed a raw reason code. Check the saved RNode pairing again when the app returns to the front or Android reports a pairing change, so a pairing removed in Bluetooth settings shows as Not paired.
The search-failed message no longer shows the Android error code; the code goes to the debug log. A saved ble:// port with no name now takes only a device named like an RNode, the rule the picker uses. A typed name or address is still matched exactly.
…ys so Android gives the same reason, authentication failed, for a PIN that did not match, a cancelled PIN prompt and a link that dropped during pairing, so that reason now shows the general pairing message. The timeout reason is unchanged. The reason is written to the info log.
A saved ble:// port with no name now takes only a device whose name starts with RNode and a space, the rule the picker and Android use. A typed name is still matched exactly.
Sidpatchy
approved these changes
Nov 24, 2026
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.
Builds on #2 (Bluetooth-off fix). Until #2 merges, this PR also shows its commits; the picker changes are the last 12 commits. #3 touches some of the same files, so whichever merges second needs a rebase.
The RNode card used to need a typed
ble://device name. It now lets you pick the connection and the device.What it does
UNBOND_REASON_AUTH_FAILED, so they share one message.ACTION_BOND_STATE_CHANGED, so a pairing removed in Android settings shows as Not paired.ble://namestill works. A bareble://now only ever picks a device named "RNode …".removeBond.Tested on a device
Pixel 8 (Android 16):
desktopTest 170, debug APK, and the iOS Kotlin compiles (
compileKotlinIosArm64,compileKotlinIosSimulatorArm64) all pass.Screenshots
Not verified
StarlingRNodeBluetoothScanner.swift) has not been compiled or run. Only the Kotlin side compiles.