Section variables iterator is an extension of Experimental: Section variables which allows you to control the order of the variables. This is achieved by introducing nrf_section_set_t.
nrf_section_set_t is an ordered group of sections. Similarly to the Experimental: Section variables, creating it requires two steps:
count
(count of sections in the set).set_name
with the name of your section): In the code of the registrant module, use the NRF_SECTION_SET_ITEM_REGISTER macro to register a section set variable. The following code example shows how to register the variable var_name of type data_type_t in the section set named section_set_name at index priority and assign to it the value var_value:
Variables registered with lower priority value are placed before the ones with higher value. For example, a variable with priority set to 0 is placed before a variable with priority set to 1. You cannot control the order of variables within one priority.
The following code example shows how to iterate through all variables in the set: