Skip to content

Conversation

Rafal-Nordic
Copy link
Contributor

Added explicit enum values for better resistance to change

@karstenkoenig
Copy link

karstenkoenig commented Feb 20, 2025

There still is a lot missing in the other ones

I think assigning fixed enums everywhere will greatly reduce the chance of accidental breakage, when enums are hardcoded people tend to make sure to not insert in the middle or reorder, when they are not it seems the order doesn't matter and one needs to be very careful during reviews to catch enums changing sequence that need to have compatibility kept in mind

Added explicit enum values for better resistance to change

Signed-off-by: Rafal Dyla <[email protected]>
Copy link

@karstenkoenig karstenkoenig left a comment

Choose a reason for hiding this comment

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

Please double check the nrfs_temp.h change so that it didn't reorder, otherwise looks good

#endif
NRFS_TEMP_EVT_REJECT, /** Request rejected. */
NRFS_TEMP_EVT_REJECT = 2, /** Request rejected. */

Choose a reason for hiding this comment

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

Does this need to be reordered? NRF_TEMP_EVT_REJECT assign 1 and NRFS_TEMP_EVT_CHANGE to 2 to make things not change?
I tried searching for NRFS_TEMP_SERVICE_SUBSCRIPTION_ENABLED and haven't found it, so I assume NRFS_TEMP_EVT_REJECT used to map to 1 and NRFS_TEMP_EVT_CHANGE wasn't used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried searching for NRFS_TEMP_SERVICE_SUBSCRIPTION_ENABLED and haven't found it, so I assume NRFS_TEMP_EVT_REJECT used to map to 1 and NRFS_TEMP_EVT_CHANGE wasn't used?
These changes are merged in the upstream zephyr and still waiting for merging in the ncs (nrfconnect/sdk-zephyr#3050)
Current order is ok, it ensures compatibility with platforms which still have temp_subscription (nrf9230)
Explicit enum values should now fix the potential problem of using incompatible ncs/soc bundle versions. REJECT will be always interpreted as 2, regardless of whether SCFW has temp_subscription.

Choose a reason for hiding this comment

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

Explicit enum values should now fix the potential problem of using incompatible ncs/soc bundle versions
Nice, thanks!

@anangl anangl merged commit ab651bf into zephyrproject-rtos:master Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants