Skip to content

nimble/ll: Introduce ble_ll_addr #2015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

andrzej-kaczmarek
Copy link
Contributor

No description provided.

@andrzej-kaczmarek andrzej-kaczmarek requested a review from sjanc March 27, 2025 16:08
@andrzej-kaczmarek andrzej-kaczmarek force-pushed the ll-addr branch 2 times, most recently from 54f3d7c to 9101a1f Compare March 27, 2025 16:14
This introduces new ble_ll_addr module which should be used to keep
track of addressed used by NimBLE LL.

For now we just move globals g_dev_addr and g_random_addr to this file,
but eventually those variables should be static and accessed only via
setters and getters.
This adds 2 new APIs that can be implemented by packages: provide public
or static device address. This allows for better support of provisioning
of Bluetooth devices address on different devices.

The nrf5x driver can act as a provider of both public and static address
which is configurable by syscfg settings. By default provider for a
static address is enabled since all nRF5x have factory programmed random
address in FICR registers. The provider for a public address can be
optionally enabled since the same registers can be also be factory
programmed with a public address (on request).
This adds an option to initialize random device address by default using
an address retrieved from an address provider.
Modules from u-blox AG are preprogrammed with a valid public device
address stored in UICR registers. This package makes this address usable
by NimBLE LL.
The public device address set by this command is applied only after HCI
Reset, thus it can be issues at any time.

To revert back to original public address set address to 0x000000000000.
In general we should pass any addr parameter to function as const since
we only rarely need to modify its contents and the address itself may
point to our device address which we never want to be able to modify
from outsied ble_ll_addr by mistake...
We should now only use helpers from ble_ll_addr to access public and
random addresses across all LL code.
Copy link
Contributor

@sjanc sjanc left a comment

Choose a reason for hiding this comment

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

I'm fine in general with this change.

Just wonder if we shouldn't do provisioning API the other way around ie. API that would be called from provider towards LL.

eg addr_ublox would have init that would call ble_ll_addr_provide_public(const *addr) and set expected value for LL, and not LL calling externally implemented function

@sjanc
Copy link
Contributor

sjanc commented Apr 14, 2025

ok, after rethinking this using newt pkg APIs is also fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants