connectedhomeip
connectedhomeip copied to clipboard
Device types and versions don't generate macros/constants from matter-devices.xml
Problem
matter-devices.xml contains definitions of device types, along with a deviceId for each type. This value is used as an argument to emberAfSetDynamicEndpoint(), however there is no way to programmatically access this value, and it must be hardcoded instead. If the Id changes later, or if the version is upgraded, the caller of emberAfSetDynamicEndpoint() must be sure to change the hardcoded value(s).
https://github.com/project-chip/connectedhomeip/blob/527467617c7a59ba3a25dde6970d13fb7a10ad2c/src/app/util/attribute-storage.h#L243
Proposed Solution
Generate a macro or constant for each device type Id and version from matter-devices.xml.