Skip to content

feat(winrtble): implement add_peripheral (connect by address)#465

Open
tanarchytan wants to merge 1 commit into
deviceplug:devfrom
tanarchytan:feat/winrtble-add-peripheral
Open

feat(winrtble): implement add_peripheral (connect by address)#465
tanarchytan wants to merge 1 commit into
deviceplug:devfrom
tanarchytan:feat/winrtble-add-peripheral

Conversation

@tanarchytan

Copy link
Copy Markdown

What

Implement the WinRT Central::add_peripheral, which currently returns Err(NotSupported). It creates a Peripheral from the given PeripheralId the same way the scanner registers a discovered device, and returns an already-known entry if present. Also adds the symmetric From for BDAddr.

Why

add_peripheral was added to the Central trait in 0.12.0 for Android but left unimplemented on Windows. Without it, a device the OS already knows (bonded, or connected to another central such as a phone) cannot be reached on Windows unless it happens to be advertising. This brings WinRT to parity with Android: get a Peripheral by address, then call connect(), which already uses FromBluetoothAddressAsync.

Tested on hardware: connects to a bonded device that is connected to another central and is not advertising, then reads and writes its GATT.

Was a NotSupported stub on Windows. Implement it the same way the scanner
registers a discovered device (create a Peripheral from the address and add
it to the manager), matching the Android backend, so a bonded or already
connected device can be reached by address without an advertisement.

Also adds the symmetric From<PeripheralId> for BDAddr.
@qwandor qwandor changed the base branch from master to dev July 15, 2026 11:58
@qwandor qwandor added the uwp (windows) Issues related to the UWP/Win10 core label Jul 15, 2026
@qwandor qwandor requested a review from qdot July 15, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

uwp (windows) Issues related to the UWP/Win10 core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants