peer_manager: add unit tests and some fixes#808
Open
anhmolt wants to merge 12 commits into
Open
Conversation
The __ALIGN macro defined in bm_zms.c is not used. Remove it and add header for the __aligned macro, which is used in the bm_zms.c file. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
Swap nrf mdk __ALIGN macro for the zephyr __aligned macro to align code. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
No need to round up to nearest word when storing bonding data. The underlying storage now handles this. Side note: The size of struct pm_peer_data_bonding in bytes is currently divisible by 4 and therefore aligned. Therefore, the round up macro currently does nothing here. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
Use the standard inline keyword instead of the cmsis defined __INLINE. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
The module variables used by the peer ranks functionality existed even when CONFIG_PM_PEER_RANKS was unset and nothing was using them. Restructure the names to group them and place them behind the CONFIG_PM_PEER_RANKS Kconfig option. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
Calling pm_init() for a second time would not clear the registered handler functions registered with pm_register(). Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
Fix an issue where calling pm_init two or more times would reset the flag data in conn_state.c but not all flags in the peer manager sub modules would be re-acquire correctly due to a check against PM_CONN_STATE_USER_FLAG_INVALID. Fix this and align how the flags are initialized. Issue appeared and has existed since an internal copy of ble_conn_state was added to peer_manager. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
The pm_address_resolve function should not return an nrf_error. Change the value returned when the peer manager module is not initialized to false. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
|
You can find the documentation preview for this PR here. |
Contributor
eivindj-nordic
left a comment
There was a problem hiding this comment.
Good cleanup! Have not looked at tests yet.
Fix an issue where the local_gatt_db_buf (in the gscm_local_db_cache_apply function) was used after going out of scope. This was not caught earlier because nothing was allocated on the stack that could corrupt the data in local_gatt_db_buf before it was used by the sd_ble_gatts_sys_attr_set SVC. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
Add unit tests for the nrf_ble_lesc submodule of the peer_manager library. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
Add first set of unit tests for peer manager library. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
Add more unit tests for peer manager. These have been assisted with AI. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add initial peer manager unit tests.
Introduces some fixes to peer manager to allow unit tests to compile and to fix some issues that became apparent when starting unit testing.