Skip to content

Conversation

@mniestroj
Copy link
Collaborator

Integrate bonding control into the gateway application with
button-triggered pairing and passkey confirmation support.

Enable 30 second window for bonding after first button press. Confirm
passkey using second button press, during that window.

@mniestroj mniestroj force-pushed the bt-auth-v2 branch 2 times, most recently from 8cae448 to 1ccf7e2 Compare December 17, 2025 14:42
@mniestroj mniestroj marked this pull request as ready for review December 17, 2025 14:55
Kconfig Outdated
help
Filter scanned devices by bonded status. Use it for authenticated
connections, so that discovered devices will be ignored when not bonded
already. Bonding is can be triggered explicitly by calling
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
already. Bonding is can be triggered explicitly by calling
already. Bonding can be triggered explicitly by calling

return;
}

if (tf.is_bonded && !sync_requested(&tf.adv_data))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on this corner case!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this file is optional - if an application is using custom scan logic, then it can also have explicit control over bonding, correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is right, it is just a "utility". But it is still useful, which is why I reused it for samples/custom_connect/.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! It might make sense to reorganize the library a bit so scan.c and bond.c are more obviously utilities, but for now I think this is great.

Copy link
Collaborator

@sam-golioth sam-golioth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Signed-off-by: Marcin Niestroj <[email protected]>
Introduce a new module for controlling Bluetooth bonding (pairing) on the
gateway. The module provides a simple API for enabling and disabling bonding
with configurable timeout support.

The API supports time-limited bonding windows where bonding can be enabled
for a specific duration and automatically disabled afterwards.

Signed-off-by: Marcin Niestroj <[email protected]>
Add support for filtering scanned BLE devices based on their bonding
status. When POUCH_GATEWAY_GATT_SCAN_FILTER_BONDED is enabled, the gateway
only connects to devices that are already bonded or when bonding is
explicitly enabled via the bonding API.

This enables authenticated connections where devices must be paired before
they can communicate with the gateway.

Signed-off-by: Marcin Niestroj <[email protected]>
Integrate bonding control into the gateway application with
button-triggered pairing and passkey confirmation support.

Enable 30 second window for bonding after first button press. Confirm
passkey using second button press, during that window.

Signed-off-by: Marcin Niestroj <[email protected]>
@mniestroj mniestroj merged commit c589d12 into main Dec 18, 2025
17 of 20 checks passed
@mniestroj mniestroj deleted the bt-auth-v2 branch December 18, 2025 15:18
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.

3 participants