Skip to content

Conversation

anhmolt
Copy link
Contributor

@anhmolt anhmolt commented Oct 22, 2025

Typedef removal from PM API and internal. Plus some refactoring.

  • squash the typedef removal commits to one or two commits when review is done.

Peer manager API was earlier aligned to having const keyword
before the parameter storage type. This one slipped through.

Signed-off-by: Andreas Moltumyr <[email protected]>
Having successfully deleted data is not an error.

Signed-off-by: Andreas Moltumyr <[email protected]>
Using a typedef for the peer_id type does not really
improve readability or give anything. Replace with
the actual storage type.

Signed-off-by: Andreas Moltumyr <[email protected]>
Using a typedef for the store token does not really
improve readability or give anything. Replace with
the actual storage type.

Signed-off-by: Andreas Moltumyr <[email protected]>
Using a typedef for the security error does not really
improve readability or give anything. Replace with
the actual storage type.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change
ble_gatt_db_srv_t  -> struct ble_gatt_db_srv
ble_gatt_db_char_t -> struct ble_gatt_db_char
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_peer_id_list_skip_t to enum pm_peer_id_list_skip
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_peer_data_id_t to enum pm_peer_data_id
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_conn_sec_procedure_t to enum pm_conn_sec_procedure
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_conn_sec_config_t to struct pm_conn_sec_config
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_peer_data_bonding_t to struct pm_peer_data_bonding
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_peer_data_local_gatt_db_t to
struct pm_peer_data_local_gatt_db to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Remove typedef pm_privacy_params_t and use ble_gap_privacy_params_t
directly in the peer_manager API. Docstrings for pm_privacy_params_t
is exactly the same as that of ble_gap_privacy_params_t in the
SoftDevice API.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_conn_sec_status_t to struct pm_conn_sec_status
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_evt_id_t to enum pm_evt_id to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Remove typedefs for the params of pm_evt_t
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Change pm_evt_t to struct pm_evt to align with NCS code style
and cleanup some code populating said event structure
with initializer array.

Signed-off-by: Andreas Moltumyr <[email protected]>
Remove typedefs for structs and enums internally in peer_manager
to align with NCS code style.

Signed-off-by: Andreas Moltumyr <[email protected]>
Place const keyword before the storage type to align with
the style for the repo.

Signed-off-by: Andreas Moltumyr <[email protected]>
Remove three helper functions by using the atomic API directly
in the other functions.

Signed-off-by: Andreas Moltumyr <[email protected]>
The verification macros in sdk_macros.h was copied from nRF5 SDK
to support quicker porting of the peer_manager and was never intended
to persist long in nRF Bare Metal option.
This removes the sdk_macros.h header file and substitutes the logic
where the VERIFY_xxx macros were used. This preserves the logic.

Signed-off-by: Andreas Moltumyr <[email protected]>
When enabling the debug checks (asserts), a value of zero for
wlist_addr_cnt triggers an assert in the peers_id_keys_get()
function. Correct it to the number of addresses that can be held
in the local addrs array passed to the peers_id_keys_get() function.

For context, on return from peers_id_keys_get(), the wlist_addr_cnt
will hold the number of addresses written to the addrs array.

Signed-off-by: Andreas Moltumyr <[email protected]>
Use of macro NRF_PM_DEBUG_CHECK is from nRF5 SDK and was never
intended to be kept for long. Remove the NRF_PM_DEBUG_CHECK
debug check macro and use the zephyr asserts module inplace of it.

Signed-off-by: Andreas Moltumyr <[email protected]>
Cleanup some header includes in peer_manager internal headers.

Signed-off-by: Andreas Moltumyr <[email protected]>
Fix code that is only compiled when CONFIG_PM_HANDLER_SEC_DELAY_MS > 0.
Fixes an assert, a missing "address of" symbol and adds a void type
cast for the error passed to APP_ERROR_CHECK macro to
silence a warning.

Signed-off-by: Andreas Moltumyr <[email protected]>
* Rename function _conn_secure to conn_secure_impl to avoid having
  a function starting with an underscore.
* Comment that the context pointer for the delay timer holds the data
  itself and does not hold a valid address.
* Place the CONFIG_PM_HANDLER_SEC_DELAY_MS preprocessor conditional
  inside of the conn_secure function so there exists only one signature
  for the function.

Signed-off-by: Andreas Moltumyr <[email protected]>
Remove hungarian notation, that is p_ and m_ from internal
peer_manager files.

Signed-off-by: Andreas Moltumyr <[email protected]>
@anhmolt anhmolt requested review from a team as code owners October 22, 2025 15:28
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Oct 22, 2025
@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label Oct 22, 2025
@github-actions
Copy link

You can find the documentation preview for this PR here.

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

Labels

changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. doc-required PR must not be merged without tech writer approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant