Skip to content

Conversation

HaavardRei
Copy link
Contributor

@HaavardRei HaavardRei commented Oct 15, 2025

Deprecates the CONFIG_BT_FIXED_PASSKEY config and adds CONFIG_BT_APP_PASSKEY as an alternative.

Updates the bt shell implementation to use the new config option.

Copy link
Contributor

@m-alperen-sener m-alperen-sener left a comment

Choose a reason for hiding this comment

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

Looks good small comments and suggestion.
Should we update the API documentation for bt_passkey_set() in conn.h ?

@HaavardRei HaavardRei force-pushed the host_fixed_passkey_deprecation branch 2 times, most recently from ee6a869 to 74e17dc Compare October 20, 2025 07:51
@HaavardRei HaavardRei marked this pull request as ready for review October 20, 2025 07:57
@zephyrbot zephyrbot added area: Bluetooth area: Tests Issues related to a particular existing or missing test area: Bluetooth Audio labels Oct 20, 2025
@zephyrbot zephyrbot added area: Bluetooth Host Bluetooth Host (excluding BR/EDR) Release Notes To be mentioned in the release notes labels Oct 20, 2025
@HaavardRei HaavardRei force-pushed the host_fixed_passkey_deprecation branch from 74e17dc to c27861a Compare October 20, 2025 08:15
@zephyrbot zephyrbot requested a review from nashif October 20, 2025 08:17
@HaavardRei HaavardRei force-pushed the host_fixed_passkey_deprecation branch 4 times, most recently from de1595b to 7a11bbb Compare October 20, 2025 12:03
Copy link
Contributor

@PavelVPV PavelVPV left a comment

Choose a reason for hiding this comment

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

LGTM, 2 minor comments.

Also, it would probably be good to have some simple multilink bsim test to check parallel pairing, but this is up to you. We can do this separately later as well.

@HaavardRei HaavardRei force-pushed the host_fixed_passkey_deprecation branch 2 times, most recently from 8c38f22 to faf7645 Compare October 20, 2025 12:18
*
* If implemented, this callback allows the application to provide passkeys for pairing.
* The valid range of passkeys is 0 - 999999, and should be expected to be zero-padded to
* 6 digits. The application shall return the passkey for pairing, or BT_PASSKEY_RAND to
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* 6 digits. The application shall return the passkey for pairing, or BT_PASSKEY_RAND to
* The valid range of passkeys is 0 - 999999. The application shall return the passkey for pairing, or BT_PASSKEY_RAND to

callback just returns uint32_t. Passkey is zero-padded on display only I guess.

@HaavardRei HaavardRei force-pushed the host_fixed_passkey_deprecation branch from faf7645 to a3fc7d7 Compare October 20, 2025 12:57
PavelVPV
PavelVPV previously approved these changes Oct 20, 2025
* :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` has been deprecated. Instead, the application can
provide passkeys for pairing using the :c:member:`bt_conn_auth_cb.app_passkey` callback, which is
available when :kconfig:option:`CONFIG_BT_APP_PASSKEY` is enabled. The application can return the
passkey for pairing, or :c:macro:`BT_PASSKEY_RAND` to generate a random passkey.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
passkey for pairing, or :c:macro:`BT_PASSKEY_RAND` to generate a random passkey.
available when :kconfig:option:`CONFIG_BT_APP_PASSKEY` is enabled. The application can return a
random passkey for pairing, or :c:macro:`BT_PASSKEY_RAND` to the Host to generate a random passkey
instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a variant!

* random and unique keys.
*
* @param conn Connection where pairing is currently active.
* @return Passkey for pairing or BT_PASSKEY_RAND to generate a random passkey.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @return Passkey for pairing or BT_PASSKEY_RAND to generate a random passkey.
* @return Passkey for pairing or BT_PASSKEY_RAND for a random passkey generated by the Host.

help
With this option enabled, the application will be able to provide passkeys for pairing
using the app_passkey() callback. If the application does not provide a passkey, a
random passkey will be generated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
random passkey will be generated.
random passkey will be generated by the Host.

Copy link
Contributor

@m-alperen-sener m-alperen-sener left a comment

Choose a reason for hiding this comment

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

I left the last comment to make it a bit more clear for user that host will keep generating random value. Up to you, just suggestions.

PavelVPV
PavelVPV previously approved these changes Oct 20, 2025
@HaavardRei
Copy link
Contributor Author

Resolved comments from @alwa-nordic offline, but changed the IO capabilities when using the app_passkey cb to support both BT_SMP_IO_KEYBOARD_DISPLAY (when defining the passkey_entry cb and app_passkey) and BT_SMP_IO_DISPLAY_ONLY (when defining just app_passkey)

Adds the BT_APP_PASSKEY Kconfig, which allows the application to provide
passkeys for pairing using the new `app_passkey()` callback.
This is an alternative to BT_FIXED_PASSKEY, which will be deprecated in
a later commit.

Signed-off-by: Håvard Reierstad <[email protected]>
The BT_FIXED_PASSKEY Kconfig option is being deprecated, and is replaced
by BT_APP_PASSKEY. The reason for the deprecation is an upcoming
errata, ES-24489, which mandates that a new passkey shall be generated
for each pairing procedure.

Signed-off-by: Håvard Reierstad <[email protected]>
Updates the bt shell API to use the new Kconfig option
BT_APP_PASSKEY instead of BT_FIXED_PASSKEY as this is being
deprecated.

Signed-off-by: Håvard Reierstad <[email protected]>
@HaavardRei HaavardRei force-pushed the host_fixed_passkey_deprecation branch from 91c8cc9 to 5b1b804 Compare October 21, 2025 11:42
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Audio area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth area: Tests Issues related to a particular existing or missing test Release Notes To be mentioned in the release notes

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

6 participants