Skip to content

Conversation

@nordicjm
Copy link
Contributor

Adds a function that allows saving of a single setting item without changing the value, or saving a subtree of settings, to the storage backend

@nordicjm
Copy link
Contributor Author

@rmsaad can you check if this would work for your application if settings_mgmt was updated to used this?

#ifdef CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_CHANGE
int settings_save_subtree_or_single_without_modification(const char *name,
bool save_if_subtree,
bool save_if_single_setting);
Copy link
Contributor

Choose a reason for hiding this comment

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

the function definition shouldn’t have a semicolon at the end.

{
int rc;
int value_size;
uint8_t read_buffer[CONFIG_CONFIG_SETTINGS_SAVE_SINGLE_SUBTREE_WITHOUT_CHANGE_VALUE_SIZE];
Copy link
Contributor

Choose a reason for hiding this comment

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

CONFIG is repeated twice.

@rmsaad
Copy link
Contributor

rmsaad commented Oct 30, 2025

@nordicjm These changes will work for my application, thanks.

Adds a function that allows saving of a single setting item without changing the value, or saving a subtree of settings, to the storage backend Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a test for the newly introduced settings_save_subtree_or_single_without_modification() settings function which allows saving a single value or subtree to NVM without modifying the values Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Enables the Kconfig for the newly introduced settings_save_subtree_or_single_without_modification() settings function so that it is tested in CI Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds functionality that allows saving a single setting to NVM using the newly added function in the settings subsystem. This also replaces calling the subtree save function if it the underlying Kconfig is enabled to reduce code paths in settings mgmt Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Expands the test to check thr functionality of the newly adding save subtree/save single setting Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
@nordicjm nordicjm added this to the v4.4.0 milestone Nov 3, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ C)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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

Labels

None yet

2 participants