-
Notifications
You must be signed in to change notification settings - Fork 426
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
base: master
Are you sure you want to change the base?
Conversation
54f3d7c
to
9101a1f
Compare
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.
9101a1f
to
d10b886
Compare
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.
d10b886
to
1415c54
Compare
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...
1415c54
to
9e2093c
Compare
We should now only use helpers from ble_ll_addr to access public and random addresses across all LL code.
9e2093c
to
9199f36
Compare
There was a problem hiding this 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
ok, after rethinking this using newt pkg APIs is also fine |
No description provided.