esp-matter
esp-matter copied to clipboard
Linker errors when adding door_position_sensor feature (CON-1339)
There are inconsistencies in the "add" and "create_door_state" functions in the door_position_state namespace that lead to linker errors.
esp_matter_feature.h
namespace door_position_sensor {
uint32_t get_id();
esp_err_t add(cluster_t *cluster);
} /* door_position_sensor */
esp_matter_feature.c
namespace door_position_sensor {
uint32_t get_id()
{
return (uint32_t)DoorLock::Feature::kDoorPositionSensor;
}
esp_err_t add(cluster_t *cluster, config_t *config)
{
if (!cluster) {
ESP_LOGE(TAG, "Cluster cannot be NULL");
return ESP_ERR_INVALID_ARG;
}
update_feature_map(cluster, get_id());
/* Attributes not managed internally */
attribute::create_door_state(cluster, 0);
esp_matter_attribute.h
attribute_t *create_door_state(cluster_t *cluster, uint8_t value);
esp_matter_attribute.c
attribute_t *create_door_state(cluster_t *cluster, nullable<uint8_t> value)
Environment
- ESP-Matter Commit Id: b3da7b
- ESP-IDF Commit Id: a322e6