-
Notifications
You must be signed in to change notification settings - Fork 19
lib: peer_manager: refactor Kconfig options #379
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
Conversation
You can find the documentation preview for this PR here. |
lib/peer_manager/Kconfig
Outdated
default y if NRF_SDH_BLE_SERVICE_CHANGED | ||
default n |
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.
This feature depends on the service changed characteristic being enabled in the SoftDevice, which happens automatically when NRF_SDH_BLE_SERVICE_CHANGED
is set.
So this should rather be:
depends on NRF_SDH_BLE_SERVICE_CHANGED
default y
Otherwise this could still be enabled when the NRF_SDH_BLE_SERVICE_CHANGED
is not enabled, and that would be an error.
2e92b15
to
24b546d
Compare
a522a29
to
fe0a2c0
Compare
fe0a2c0
to
00ffe64
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.
Seems commits might need squashing?
lib/peer_manager/Kconfig
Outdated
|
||
config PM_SERVICE_CHANGED_ENABLED | ||
config PM_SERVICE_CHANGED | ||
bool "Enable/disable the service changed management for GATT server in Peer Manager." |
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.
bool "Enable/disable the service changed management for GATT server in Peer Manager." | |
bool "Service changed management for GATT server in Peer Manager." |
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.
Please have another look, this was addressed in a separate commit.
} | ||
|
||
#if CONFIG_PM_SERVICE_CHANGED_ENABLED | ||
#if CONFIG_PM_SERVICE_CHANGED |
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.
these are defines, change them all to #ifdef
or #if defined(CONFIG_...
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.
this is not fixed
* @retval NRF_ERROR_INTERNAL If an internal error occurred. | ||
* @retval NRF_ERROR_NOT_SUPPORTED If peer rank functionality has been disabled via the @ref | ||
* PM_PEER_RANKS_ENABLED configuration option. | ||
* PM_PEER_RANKS configuration option. |
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.
@ before will link to it
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.
Please have another look, this was addressed in a separate commit.
lib/peer_manager/Kconfig
Outdated
|
||
config PM_PEER_RANKS_ENABLED | ||
config PM_PEER_RANKS | ||
bool "Enable/disable the peer rank management in Peer Manager." |
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.
fix above issues in whole PR, never start a Kconfig prompt with enable
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.
Please have another look, this was addressed in a separate commit.
lib/peer_manager/Kconfig
Outdated
config PM_LESC_ENABLED | ||
config PM_LESC | ||
bool "Enable/disable LESC support in Peer Manager." | ||
default n |
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.
default n |
I don't see why they should be squashed. It's very clear what each commit does and how they separate each atomic change. |
} | ||
|
||
#if CONFIG_PM_SERVICE_CHANGED_ENABLED | ||
#if CONFIG_PM_SERVICE_CHANGED |
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.
this is not fixed
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.
Could you add a commit where you change CONFIG_REQ
to PM_EVT_CONN_SEC_CONFIG_REQ
here
* @brief Function for sending a CONFIG_REQ event. |
The CONFIG_ namespace is for Kconfigs.
a3d73d2
to
228427e
Compare
extern void pm_pdb_evt_handler(pm_evt_t *p_event); | ||
extern void sm_pdb_evt_handler(pm_evt_t *p_event); | ||
#if !defined(CONFIG_PM_SERVICE_CHANGED_ENABLED) || (CONFIG_PM_SERVICE_CHANGED_ENABLED == 1) | ||
#if !defined(CONFIG_PM_SERVICE_CHANGED) || (CONFIG_PM_SERVICE_CHANGED == 1) |
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.
This does not make sense with the (new) Kconfig system. This logic probably took care of the "default" behavior in the nRF5 SDK, when the config was not defined.
#if !defined(CONFIG_PM_SERVICE_CHANGED) || (CONFIG_PM_SERVICE_CHANGED == 1) | |
#if defined(CONFIG_PM_SERVICE_CHANGED) |
Here and others.
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 agree
5bf2713
to
c211035
Compare
c211035
to
e5924c8
Compare
I see your point, though I think many of the changes are too small to deserve its own commit when the other commits are quite similar. For issues outside of these commits it also helps with bisectability to squash the commits, as it could remove the need for a couple of steps in the bisect process. |
|
||
* Updated: | ||
|
||
* The ``CONFIG_PM_SERVICE_CHANGED_ENABLED`` Kconfig option to :kconfig:option:`CONFIG_PM_SERVICE_CHANGED`. |
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.
Here and others
* The ``CONFIG_PM_SERVICE_CHANGED_ENABLED`` Kconfig option to :kconfig:option:`CONFIG_PM_SERVICE_CHANGED`. | |
* The ``CONFIG_PM_SERVICE_CHANGED_ENABLED`` Kconfig option is renamed to :kconfig:option:`CONFIG_PM_SERVICE_CHANGED`. |
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.
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.
Sure
* | ||
* @note This function is deprecated. LESC keys are now handled internally if @ref PM_LESC_ENABLED | ||
* is true. If @ref PM_LESC_ENABLED is false, this function works as before. | ||
* @note This function is deprecated. LESC keys are now handled internally if the @c CONFIG_PM_LESC |
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.
Use @deprecated?
* @note This function is deprecated. LESC keys are now handled internally if the @c CONFIG_PM_LESC | |
* @deprecated LESC keys are now handled internally if the @c CONFIG_PM_LESC |
* Kconfig option is enabled. If the @c CONFIG_PM_LESC Kconfig option is disabled, this | ||
* function works as before. |
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.
What do you mean by this last sentence?
If the @c CONFIG_PM_LESC Kconfig option is disabled, this function works as before.
If this is still meant to be used when CONFIG_PM_LESC Kconfig option is disabled, this is not deprecated.
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.
Not sure, this is from the original Doxygen. I merely changed the Kconfig reference.
89466e2
to
3eb8aea
Compare
I squashed the mechanical commits that can make sense to squash. |
3eb8aea
to
afcd030
Compare
5c34624
to
5272011
Compare
* Renames the `PM_SERVICE_CHANGED_ENABLED`, `PM_PEER_RANKS_ENABLED`, `PM_LESC_ENABLED`, and `PM_RA_PROTECTION_ENABLED` kconfig options to align with Zephyr's coding style. * Improves prompts and descriptions of Kconfig options. * Moves secondary `PM_RA_PROTECTION` Kconfigs inside conditional block. * Removes explicit `default n`. * Fixes doxygen sections related to Kconfig options. * Refactors the Peer Manager to use the `#if defined` (or `#if !defined`) preprocessor pattern where appropriate. Signed-off-by: Mirko Covizzi <[email protected]>
Conditionally compile Auth Status Tracker. Signed-off-by: Mirko Covizzi <[email protected]>
If not using a GATT server, or using a server without a service changed characteristic, this Kconfig option should be disabled to save code space. Refactors this Kconfig option in order to represent this relationship accordingly. Signed-off-by: Mirko Covizzi <[email protected]>
* Fixes a typo. * Removes extra newlines. Signed-off-by: Mirko Covizzi <[email protected]>
5272011
to
5e94761
Compare
Refactor Peer Manager Kconfig options.