Skip to content

Commit 33ec416

Browse files
committed
Merge branch 'add_general_diagnostic_releated_optional_attributes' into 'main'
components/esp_matter:add optional attributes for general diagnostic cluster See merge request app-frameworks/esp-matter!1063
2 parents a960281 + c197254 commit 33ec416

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

components/esp_matter/esp_matter_attribute.cpp

+30
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,36 @@ attribute_t *create_up_time(cluster_t *cluster, uint64_t value)
505505
ATTRIBUTE_FLAG_MANAGED_INTERNALLY | ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint64(value));
506506
}
507507

508+
attribute_t *create_total_operational_hours(cluster_t *cluster, uint32_t value)
509+
{
510+
return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::TotalOperationalHours::Id,
511+
ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint32(value));
512+
}
513+
514+
attribute_t *create_boot_reason(cluster_t *cluster, uint8_t value)
515+
{
516+
return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::BootReason::Id,
517+
ATTRIBUTE_FLAG_NONE, esp_matter_enum8(value));
518+
}
519+
520+
attribute_t *create_active_hardware_faults(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
521+
{
522+
return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::ActiveHardwareFaults::Id,
523+
ATTRIBUTE_FLAG_NONE, esp_matter_array(value, length, count));
524+
}
525+
526+
attribute_t *create_active_radio_faults(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
527+
{
528+
return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::ActiveRadioFaults::Id,
529+
ATTRIBUTE_FLAG_NONE, esp_matter_array(value, length, count));
530+
}
531+
532+
attribute_t *create_active_network_faults(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
533+
{
534+
return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::ActiveNetworkFaults::Id,
535+
ATTRIBUTE_FLAG_NONE, esp_matter_array(value, length, count));
536+
}
537+
508538
attribute_t *create_test_event_triggers_enabled(cluster_t *cluster, bool value)
509539
{
510540
return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id,

components/esp_matter/esp_matter_attribute.h

+5
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ namespace attribute {
152152
attribute_t *create_network_interfaces(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
153153
attribute_t *create_reboot_count(cluster_t *cluster, uint16_t value);
154154
attribute_t *create_up_time(cluster_t *cluster, uint64_t value);
155+
attribute_t *create_total_operational_hours(cluster_t *cluster, uint32_t value);
156+
attribute_t *create_boot_reason(cluster_t *cluster, uint8_t value);
157+
attribute_t *create_active_hardware_faults(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
158+
attribute_t *create_active_radio_faults(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
159+
attribute_t *create_active_network_faults(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
155160
attribute_t *create_test_event_triggers_enabled(cluster_t *cluster, bool value);
156161
} /* attribute */
157162
} /* general_diagnostics */

0 commit comments

Comments
 (0)