Skip to content

Commit 7e54123

Browse files
committed
Merge branch 'cluster_updates_1_4' into 'main'
components/esp-matter: Update application clusters wrt matter spec. See merge request app-frameworks/esp-matter!916
2 parents b0a7162 + 8fe2b63 commit 7e54123

12 files changed

+1089
-55
lines changed

components/esp_matter/esp_matter_attribute.cpp

+276
Large diffs are not rendered by default.

components/esp_matter/esp_matter_attribute.h

+49
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ attribute_t *create_extension(cluster_t *cluster, uint8_t *value, uint16_t lengt
6060
attribute_t *create_subjects_per_access_control_entry(cluster_t *cluster, uint16_t value);
6161
attribute_t *create_targets_per_access_control_entry(cluster_t *cluster, uint16_t value);
6262
attribute_t *create_access_control_entries_per_fabric(cluster_t *cluster, uint16_t value);
63+
#if CHIP_CONFIG_USE_ACCESS_RESTRICTIONS
64+
attribute_t *create_commissioning_arl(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
65+
attribute_t *create_arl(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
66+
#endif
6367
} /* attribute */
6468
} /* access_control */
6569

@@ -119,6 +123,11 @@ attribute_t *create_basic_commissioning_info(cluster_t *cluster, uint8_t *value,
119123
attribute_t *create_regulatory_config(cluster_t *cluster, uint8_t value);
120124
attribute_t *create_location_capability(cluster_t *cluster, uint8_t value);
121125
attribute_t *create_supports_concurrent_connection(cluster_t *cluster, bool value);
126+
attribute_t *create_tc_accepted_version(cluster_t *cluster, uint16_t value);
127+
attribute_t *create_tc_min_required_version(cluster_t *cluster, uint16_t value);
128+
attribute_t *create_tc_acknowledgements(cluster_t *cluster, uint16_t value);
129+
attribute_t *create_tc_acknowledgements_required(cluster_t *cluster, bool value);
130+
attribute_t *create_tc_update_deadline(cluster_t *cluster, nullable<uint32_t> value);
122131
} /* attribute */
123132
} /* general_commissioning */
124133

@@ -238,6 +247,8 @@ attribute_t *create_security_policy(cluster_t *cluster, uint8_t *value, uint16_t
238247
attribute_t *create_channel_page0_mask(cluster_t *cluster, uint8_t *value, uint16_t length);
239248
attribute_t *create_operational_dataset_components(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
240249
attribute_t *create_active_network_faults(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
250+
attribute_t *create_ext_address(cluster_t *cluster, nullable<uint64_t> value);
251+
attribute_t *create_rloc16(cluster_t *cluster, nullable<uint16_t> value);
241252
} /* attribute */
242253
} /* thread_network_diagnostics */
243254

@@ -272,6 +283,7 @@ namespace attribute {
272283
attribute_t *create_vendor_name(cluster_t *cluster, char *value, uint16_t length);
273284
attribute_t *create_vendor_id(cluster_t *cluster, uint16_t value);
274285
attribute_t *create_product_name(cluster_t *cluster, char *value, uint16_t length);
286+
attribute_t *create_product_id(cluster_t *cluster, uint16_t value);
275287
attribute_t *create_node_label(cluster_t *cluster, char *value, uint16_t length);
276288
attribute_t *create_hardware_version(cluster_t *cluster, uint16_t value);
277289
attribute_t *create_hardware_version_string(cluster_t *cluster, char *value, uint16_t length);
@@ -405,6 +417,8 @@ attribute_t *create_airflow_direction(cluster_t *cluster, uint8_t value);
405417
} /* fan_control */
406418

407419
namespace thermostat {
420+
const uint8_t k_max_active_preset_handle = 16u;
421+
const uint8_t k_max_active_schedule_handle = 16u;
408422
namespace attribute {
409423
attribute_t *create_local_temperature(cluster_t *cluster, nullable<int16_t> value);
410424
attribute_t *create_outdoor_temperature(cluster_t *cluster, nullable<int16_t> value);
@@ -455,6 +469,17 @@ attribute_t *create_ac_error_code(cluster_t *cluster, uint32_t value);
455469
attribute_t *create_ac_louver_position(cluster_t *cluster, uint8_t value);
456470
attribute_t *create_ac_coil_temperature(cluster_t *cluster, nullable<int16_t> value);
457471
attribute_t *create_ac_capacity_format(cluster_t *cluster, uint8_t value);
472+
attribute_t *create_preset_type(cluster_t *cluster, uint8_t * value, uint16_t length, uint16_t count);
473+
attribute_t *create_schedule_type(cluster_t *cluster, uint8_t * value, uint16_t length, uint16_t count);
474+
attribute_t *create_number_of_presets(cluster_t *cluster, uint8_t value);
475+
attribute_t *create_number_of_schedules(cluster_t *cluster, uint8_t value);
476+
attribute_t *create_number_of_schedule_transitions(cluster_t *cluster, uint8_t value);
477+
attribute_t *create_number_of_schedule_transition_per_day(cluster_t *cluster, nullable<uint8_t> value);
478+
attribute_t *create_active_preset_handle(cluster_t *cluster, uint8_t*value, uint16_t length);
479+
attribute_t *create_active_schedule_handle(cluster_t *cluster, uint8_t *value, uint16_t length);
480+
attribute_t *create_presets(cluster_t *cluster, uint8_t * value, uint16_t length, uint16_t count);
481+
attribute_t *create_schedules(cluster_t *cluster, uint8_t * value, uint16_t length, uint16_t count);
482+
attribute_t *create_setpoint_hold_expiry_timestamp(cluster_t *cluster, nullable<uint32_t> value);
458483
} /* attribute */
459484
} /* thermostat */
460485

@@ -667,6 +692,10 @@ attribute_t *create_operational_error(cluster_t *cluster, uint8_t value);
667692

668693
namespace door_lock {
669694
constexpr uint8_t k_max_language_length = 3;
695+
constexpr uint8_t k_max_aliro_reader_verification_key = 65;
696+
constexpr uint8_t k_max_aliro_reader_group_identifier = 16;
697+
constexpr uint8_t k_max_aliro_reader_group_sub_identifier = 16;
698+
constexpr uint8_t k_max_aliro_group_resolving_key = 16;
670699

671700
namespace attribute {
672701
attribute_t *create_lock_state(cluster_t *cluster, nullable<uint8_t> value);
@@ -705,6 +734,15 @@ attribute_t *create_user_code_temporary_disable_time(cluster_t *cluster, uint8_t
705734
attribute_t *create_send_pin_over_the_air(cluster_t *cluster, bool value);
706735
attribute_t *create_require_pin_for_remote_operation(cluster_t *cluster, bool value);
707736
attribute_t *create_expiring_user_timeout(cluster_t *cluster, uint16_t value);
737+
attribute_t *create_aliro_reader_verification_key(cluster_t *cluster, uint8_t * value, uint16_t length);
738+
attribute_t *create_aliro_reader_group_identifier(cluster_t *cluster, uint8_t * value, uint16_t length);
739+
attribute_t *create_aliro_reader_group_sub_identifier(cluster_t *cluster, uint8_t * value, uint16_t length);
740+
attribute_t *create_aliro_expedited_transaction_supported_protocol_versions(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
741+
attribute_t *create_aliro_group_resolving_key(cluster_t *cluster, uint8_t * value, uint16_t length);
742+
attribute_t *create_aliro_supported_bleuwb_protocol_versions(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
743+
attribute_t *create_aliro_ble_advertising_version(cluster_t *cluster, uint8_t value);
744+
attribute_t *create_number_of_aliro_credential_issuer_keys_supported(cluster_t *cluster, uint16_t value);
745+
attribute_t *create_number_of_aliro_endpoint_keys_supported(cluster_t *cluster, uint16_t value);
708746
} /* attribute */
709747
} /* door_lock */
710748

@@ -799,6 +837,17 @@ namespace attribute {
799837
attribute_t *create_occupancy(cluster_t *cluster, uint8_t value);
800838
attribute_t *create_occupancy_sensor_type(cluster_t *cluster, uint8_t value);
801839
attribute_t *create_occupancy_sensor_type_bitmap(cluster_t *cluster, uint8_t value);
840+
attribute_t *create_hold_time(cluster_t *cluster, uint16_t value);
841+
attribute_t *create_hold_time_limits(cluster_t *cluster, uint8_t* value, uint16_t length, uint16_t count);
842+
attribute_t *create_pir_occupied_to_unoccupied_delay(cluster_t *cluster, uint16_t value);
843+
attribute_t *create_pir_unoccupied_to_occupied_delay(cluster_t *cluster, uint16_t value);
844+
attribute_t *create_pir_unoccupied_to_occupied_threshold(cluster_t *cluster, uint8_t value);
845+
attribute_t *create_ultrasonic_occupied_to_unoccupied_delay(cluster_t *cluster, uint16_t value);
846+
attribute_t *create_ultrasonic_unoccupied_to_occupied_delay(cluster_t *cluster, uint16_t value);
847+
attribute_t *create_ultrasonic_unoccupied_to_occupied_threshold(cluster_t *cluster, uint8_t value);
848+
attribute_t *create_physical_contact_occupied_to_unoccupied_delay(cluster_t *cluster, uint16_t value);
849+
attribute_t *create_physical_contact_unoccupied_to_occupied_delay(cluster_t *cluster, uint16_t value);
850+
attribute_t *create_physical_contact_unoccupied_to_occupied_threshold(cluster_t *cluster, uint8_t value);
802851
} /* attribute */
803852
} /* occupancy_sensing */
804853

components/esp_matter/esp_matter_attribute_bounds.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,7 @@ void add_bounds_cb(cluster_t *cluster)
132132
}
133133
case LevelControl::Attributes::MinLevel::Id: {
134134
esp_matter_attr_val_t max_val = esp_matter_invalid(NULL);
135-
uint8_t min = 1, max = UINT8_MAX;
136-
if(cluster::get_attribute_value(cluster, LevelControl::Attributes::MaxLevel::Id,
137-
&max_val) == ESP_OK)
138-
{
139-
max = max_val.val.u8;
140-
}
135+
uint8_t min = 1, max = 254;
141136
esp_matter::attribute::add_bounds(current_attribute, esp_matter_uint8(min), esp_matter_uint8(max));
142137
break;
143138
}

components/esp_matter/esp_matter_cluster.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
201201
}
202202

203203
event::create_access_control_entry_changed(cluster);
204-
event::create_access_control_extension_changed(cluster);
205204

206205
return cluster;
207206
}
@@ -729,6 +728,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
729728

730729
/* Attributes managed internally */
731730
global::attribute::create_feature_map(cluster, 0);
731+
attribute::create_unique_id(cluster, NULL, 0);
732732

733733
/* Attributes not managed internally */
734734
global::attribute::create_cluster_revision(cluster, cluster_revision);
@@ -1619,7 +1619,7 @@ const function_generic_t function_list[] = {
16191619
};
16201620
const int function_flags = CLUSTER_FLAG_PRE_ATTRIBUTE_CHANGED_FUNCTION;
16211621

1622-
cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
1622+
cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_t features)
16231623
{
16241624
cluster_t *cluster = cluster::create(endpoint, LaundryWasherControls::Id, flags);
16251625
VerifyOrReturnValue(cluster, NULL, ESP_LOGE(TAG, "Could not create cluster. cluster_id: 0x%08" PRIX32, LaundryWasherControls::Id));
@@ -1642,6 +1642,12 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
16421642
create_default_binding_cluster(endpoint);
16431643
}
16441644

1645+
if (features & feature::spin::get_id()) {
1646+
feature::spin::add(cluster, &(config->spin));
1647+
}
1648+
if (features & feature::rinse::get_id()) {
1649+
feature::rinse::add(cluster, &(config->rinse));
1650+
}
16451651
return cluster;
16461652
}
16471653
} /* laundry_washer_controls */

components/esp_matter/esp_matter_cluster.h

+2
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags);
480480

481481
namespace laundry_washer_controls {
482482
typedef struct config {
483+
feature::spin::config_t spin;
484+
feature::rinse::config_t rinse;
483485
void *delegate;
484486
config() : delegate(nullptr) {}
485487
} config_t;

components/esp_matter/esp_matter_command.cpp

+139
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,18 @@ static esp_err_t esp_matter_command_callback_commissioning_complete(const Concre
170170
return ESP_OK;
171171
}
172172

173+
static esp_err_t esp_matter_command_callback_set_tc_acknowledgements(const ConcreteCommandPath &command_path,
174+
TLVReader &tlv_data, void *opaque_ptr)
175+
{
176+
chip::app::Clusters::GeneralCommissioning::Commands::SetTCAcknowledgements::DecodableType command_data;
177+
CHIP_ERROR error = Decode(tlv_data, command_data);
178+
if (error == CHIP_NO_ERROR) {
179+
emberAfGeneralCommissioningClusterSetTCAcknowledgementsCallback((CommandHandler *)opaque_ptr, command_path,
180+
command_data);
181+
}
182+
return ESP_OK;
183+
}
184+
173185
static esp_err_t esp_matter_command_callback_open_commissioning_window(const ConcreteCommandPath &command_path,
174186
TLVReader &tlv_data, void *opaque_ptr)
175187
{
@@ -1079,6 +1091,28 @@ static esp_err_t esp_matter_command_callback_unbolt_door(const ConcreteCommandPa
10791091
return ESP_OK;
10801092
}
10811093

1094+
static esp_err_t esp_matter_command_callback_set_aliro_reader_config(const ConcreteCommandPath &command_path, TLVReader &tlv_data,
1095+
void *opaque_ptr)
1096+
{
1097+
chip::app::Clusters::DoorLock::Commands::SetAliroReaderConfig::DecodableType command_data;
1098+
CHIP_ERROR error = Decode(tlv_data, command_data);
1099+
if (error == CHIP_NO_ERROR) {
1100+
emberAfDoorLockClusterSetAliroReaderConfigCallback((CommandHandler *)opaque_ptr, command_path, command_data);
1101+
}
1102+
return ESP_OK;
1103+
}
1104+
1105+
static esp_err_t esp_matter_command_callback_clear_aliro_reader_config(const ConcreteCommandPath &command_path, TLVReader &tlv_data,
1106+
void *opaque_ptr)
1107+
{
1108+
chip::app::Clusters::DoorLock::Commands::ClearAliroReaderConfig::DecodableType command_data;
1109+
CHIP_ERROR error = Decode(tlv_data, command_data);
1110+
if (error == CHIP_NO_ERROR) {
1111+
emberAfDoorLockClusterClearAliroReaderConfigCallback((CommandHandler *)opaque_ptr, command_path, command_data);
1112+
}
1113+
return ESP_OK;
1114+
}
1115+
10821116
static esp_err_t esp_matter_command_callback_setpoint_raise_lower(const ConcreteCommandPath &command_path,
10831117
TLVReader &tlv_data, void *opaque_ptr)
10841118
{
@@ -1123,6 +1157,28 @@ static esp_err_t esp_matter_command_callback_clear_weekly_schedule(const Concret
11231157
return ESP_OK;
11241158
}
11251159

1160+
static esp_err_t esp_matter_command_callback_set_active_schedule_request(const ConcreteCommandPath &command_path,
1161+
TLVReader &tlv_data, void *opaque_ptr)
1162+
{
1163+
chip::app::Clusters::Thermostat::Commands::SetActiveScheduleRequest::DecodableType command_data;
1164+
CHIP_ERROR error = Decode(tlv_data, command_data);
1165+
if (error == CHIP_NO_ERROR) {
1166+
emberAfThermostatClusterSetActiveScheduleRequestCallback((CommandHandler *)opaque_ptr, command_path, command_data);
1167+
}
1168+
return ESP_OK;
1169+
}
1170+
1171+
static esp_err_t esp_matter_command_callback_set_active_preset_request(const ConcreteCommandPath &command_path,
1172+
TLVReader &tlv_data, void *opaque_ptr)
1173+
{
1174+
chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::DecodableType command_data;
1175+
CHIP_ERROR error = Decode(tlv_data, command_data);
1176+
if (error == CHIP_NO_ERROR) {
1177+
emberAfThermostatClusterSetActivePresetRequestCallback((CommandHandler *)opaque_ptr, command_path, command_data);
1178+
}
1179+
return ESP_OK;
1180+
}
1181+
11261182
static esp_err_t esp_matter_command_callback_thread_reset_counts(const ConcreteCommandPath &command_path,
11271183
TLVReader &tlv_data, void *opaque_ptr)
11281184
{
@@ -1429,6 +1485,26 @@ static esp_err_t esp_matter_command_callback_disable_action_with_duration(const
14291485
return ESP_OK;
14301486
}
14311487

1488+
static esp_err_t esp_matter_command_callback_review_fabric_restrictions(const ConcreteCommandPath &command_path, TLVReader &tlv_data, void *opaque_ptr)
1489+
{
1490+
chip::app::Clusters::AccessControl::Commands::ReviewFabricRestrictions::DecodableType command_data;
1491+
CHIP_ERROR error = Decode(tlv_data, command_data);
1492+
if (error == CHIP_NO_ERROR) {
1493+
emberAfAccessControlClusterReviewFabricRestrictionsCallback((CommandHandler *)opaque_ptr, command_path, command_data);
1494+
}
1495+
return ESP_OK;
1496+
}
1497+
1498+
static esp_err_t esp_matter_command_callback_keep_active(const ConcreteCommandPath &command_path, TLVReader &tlv_data, void *opaque_ptr)
1499+
{
1500+
chip::app::Clusters::BridgedDeviceBasicInformation::Commands::KeepActive::DecodableType command_data;
1501+
CHIP_ERROR error = Decode(tlv_data, command_data);
1502+
if (error == CHIP_NO_ERROR) {
1503+
emberAfBridgedDeviceBasicInformationClusterKeepActiveCallback((CommandHandler *)opaque_ptr, command_path, command_data);
1504+
}
1505+
return ESP_OK;
1506+
}
1507+
14321508
static esp_err_t esp_matter_command_callback_send_key(const ConcreteCommandPath &command_path, TLVReader &tlv_data, void *opaque_ptr)
14331509
{
14341510
chip::app::Clusters::KeypadInput::Commands::SendKey::DecodableType command_data;
@@ -1559,6 +1635,33 @@ command_t *create_disable_action_with_duration(cluster_t *cluster)
15591635
} /* command */
15601636
} /* actions */
15611637

1638+
namespace access_control {
1639+
namespace command {
1640+
command_t *create_review_fabric_restrictions(cluster_t *cluster)
1641+
{
1642+
return esp_matter::command::create(cluster, AccessControl::Commands::ReviewFabricRestrictions::Id, COMMAND_FLAG_ACCEPTED,
1643+
esp_matter_command_callback_review_fabric_restrictions);
1644+
}
1645+
1646+
command_t *create_review_fabric_restrictions_response(cluster_t *cluster)
1647+
{
1648+
return esp_matter::command::create(cluster, AccessControl::Commands::ReviewFabricRestrictionsResponse::Id, COMMAND_FLAG_GENERATED, NULL);
1649+
}
1650+
1651+
} /* command */
1652+
} /* access_control */
1653+
1654+
namespace bridged_device_basic_information {
1655+
namespace command {
1656+
command_t *create_keep_active(cluster_t *cluster)
1657+
{
1658+
return esp_matter::command::create(cluster, BridgedDeviceBasicInformation::Commands::KeepActive::Id, COMMAND_FLAG_ACCEPTED,
1659+
esp_matter_command_callback_keep_active);
1660+
}
1661+
1662+
} /* command */
1663+
} /* bridged_device_basic_information */
1664+
15621665
namespace thread_network_diagnostics {
15631666
namespace command {
15641667

@@ -1783,6 +1886,18 @@ command_t *create_commissioning_complete_response(cluster_t *cluster)
17831886
COMMAND_FLAG_GENERATED, NULL);
17841887
}
17851888

1889+
command_t *create_set_tc_acknowledgements(cluster_t *cluster)
1890+
{
1891+
return esp_matter::command::create(cluster, GeneralCommissioning::Commands::SetTCAcknowledgements::Id,
1892+
COMMAND_FLAG_ACCEPTED, esp_matter_command_callback_set_tc_acknowledgements);
1893+
}
1894+
1895+
command_t *create_set_tc_acknowledgements_response(cluster_t *cluster)
1896+
{
1897+
return esp_matter::command::create(cluster, GeneralCommissioning::Commands::SetTCAcknowledgementsResponse::Id,
1898+
COMMAND_FLAG_GENERATED, NULL);
1899+
}
1900+
17861901
} /* command */
17871902
} /* general_commissioning */
17881903

@@ -2580,6 +2695,18 @@ command_t *create_get_weekly_schedule_response(cluster_t *cluster)
25802695
NULL);
25812696
}
25822697

2698+
command_t *create_set_active_schedule_request(cluster_t *cluster)
2699+
{
2700+
return esp_matter::command::create(cluster, Thermostat::Commands::SetActiveScheduleRequest::Id, COMMAND_FLAG_ACCEPTED,
2701+
esp_matter_command_callback_set_active_schedule_request);
2702+
}
2703+
2704+
command_t *create_set_active_preset_request(cluster_t *cluster)
2705+
{
2706+
return esp_matter::command::create(cluster, Thermostat::Commands::SetActivePresetRequest::Id, COMMAND_FLAG_ACCEPTED,
2707+
esp_matter_command_callback_set_active_preset_request);
2708+
}
2709+
25832710
} /* command */
25842711
} /* thermostat */
25852712

@@ -2785,6 +2912,18 @@ command_t *create_unbolt_door(cluster_t *cluster)
27852912
esp_matter_command_callback_unbolt_door);
27862913
}
27872914

2915+
command_t *create_set_aliro_reader_config(cluster_t *cluster)
2916+
{
2917+
return esp_matter::command::create(cluster, DoorLock::Commands::SetAliroReaderConfig::Id, COMMAND_FLAG_ACCEPTED,
2918+
esp_matter_command_callback_set_aliro_reader_config);
2919+
}
2920+
2921+
command_t *create_clear_aliro_reader_config(cluster_t *cluster)
2922+
{
2923+
return esp_matter::command::create(cluster, DoorLock::Commands::ClearAliroReaderConfig::Id, COMMAND_FLAG_ACCEPTED,
2924+
esp_matter_command_callback_clear_aliro_reader_config);
2925+
}
2926+
27882927
} /* command */
27892928
} /* door_lock */
27902929

0 commit comments

Comments
 (0)