Skip to content

Commit b403a65

Browse files
docs: Update docs to match the updated cluster APIs
1 parent c34a940 commit b403a65

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

docs/en/developing.rst

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ for clarity on the terms like endpoints, clusters, etc. that are used in this se
651651
::
652652

653653
node::config_t node_config;
654-
node_t *node = node::create(&node_config, app_attribute_update_cb, NULL);
654+
node_t *node = node::create(&node_config, app_attribute_update_cb, app_identification_cb, NULL /* optional priv data */);
655655

656656
- We will use the ``color_temperature_light`` standard device type in this
657657
case. All standard device types are available in :project_file:`esp_matter_endpoint.h <components/esp_matter/data_model/esp_matter_endpoint.h>` header file.
@@ -663,7 +663,7 @@ for clarity on the terms like endpoints, clusters, etc. that are used in this se
663663
color_temperature_light::config_t light_config;
664664
light_config.on_off.on_off = DEFAULT_POWER;
665665
light_config.level_control.current_level = DEFAULT_BRIGHTNESS;
666-
endpoint_t *endpoint = color_temperature_light::create(node, &light_config, ENDPOINT_FLAG_NONE);
666+
endpoint_t *endpoint = color_temperature_light::create(node, &light_config, ENDPOINT_FLAG_NONE, NULL /* priv data */);
667667

668668
In this case, we create the light using the ``color_temperature_light::create()`` function. Similarly, multiple
669669
endpoints can be created on the same node. Check the following
@@ -697,7 +697,21 @@ for clarity on the terms like endpoints, clusters, etc. that are used in this se
697697
return err;
698698
}
699699

700-
2.5.1.3 Device Drivers
700+
2.5.1.3 Identify Callback
701+
^^^^^^^^^^^^^^^^^^^^^^^^^^
702+
- This callback is invoked when clients interact with the Identify Cluster. In the callback implementation,
703+
an endpoint can identify itself. (e.g., by flashing an LED or light).
704+
705+
::
706+
707+
esp_err_t app_identification_cb(identification::callback_type_t type, uint16_t endpoint_id, uint8_t effect_id,
708+
uint8_t effect_variant, void *priv_data)
709+
{
710+
ESP_LOGI(TAG, "Identification callback: type: %u, effect: %u, variant: %u", type, effect_id, effect_variant);
711+
return ESP_OK;
712+
}
713+
714+
2.5.1.4 Device Drivers
701715
^^^^^^^^^^^^^^^^^^^^^^
702716

703717
- The drivers, depending on the device, are typically initialized and
@@ -774,29 +788,29 @@ creating in the *app_main.cpp* of the example. Examples:
774788
::
775789

776790
on_off_light::config_t light_config;
777-
endpoint_t *endpoint = on_off_light::create(node, &light_config, ENDPOINT_FLAG_NONE);
791+
endpoint_t *endpoint = on_off_light::create(node, &light_config, ENDPOINT_FLAG_NONE, NULL /* priv data */);
778792

779793
- fan:
780794

781795
::
782796

783797
fan::config_t fan_config;
784-
endpoint_t *endpoint = fan::create(node, &fan_config, ENDPOINT_FLAG_NONE);
798+
endpoint_t *endpoint = fan::create(node, &fan_config, ENDPOINT_FLAG_NONE, NULL /* priv data */);
785799

786800

787801
- door_lock:
788802

789803
::
790804

791805
door_lock::config_t door_lock_config;
792-
endpoint_t *endpoint = door_lock::create(node, &door_lock_config, ENDPOINT_FLAG_NONE);
806+
endpoint_t *endpoint = door_lock::create(node, &door_lock_config, ENDPOINT_FLAG_NONE, NULL /* priv data */);
793807

794808
- window_covering:
795809

796810
::
797811

798812
window_covering::config_t window_covering_config(static_cast<uint8_t>(chip::app::Clusters::WindowCovering::EndProductType::kTiltOnlyInteriorBlind));
799-
endpoint_t *endpoint = endpoint::window_covering::create(node, &window_covering_config, ENDPOINT_FLAG_NONE);
813+
endpoint_t *endpoint = window_covering_device::create(node, &window_covering_config, ENDPOINT_FLAG_NONE, NULL /* priv data */);
800814

801815
The ``window_covering`` ``config_t`` structure includes a constructor that allows specifying
802816
an end product type different than the default one, which is "Roller shade".
@@ -807,7 +821,7 @@ creating in the *app_main.cpp* of the example. Examples:
807821
::
808822

809823
pump::config_t pump_config(1, 10, 20);
810-
endpoint_t *endpoint = pump::create(node, &pump_config, ENDPOINT_FLAG_NONE);
824+
endpoint_t *endpoint = pump::create(node, &pump_config, ENDPOINT_FLAG_NONE, NULL /* priv data */);
811825

812826
The ``pump`` ``config_t`` structure includes a constructor that allows specifying
813827
maximum pressure, maximum speed and maximum flow values. If they aren't set, they will be set to null by default.
@@ -867,28 +881,15 @@ Examples:
867881

868882
::
869883

870-
bool default_on_off = true;
871-
attribute_t *attribute = on_off::attribute::create_on_off(cluster, default_on_off);
872-
873-
- attribute: cluster_revision:
874-
875-
::
876-
877-
uint16_t default_cluster_revision = 1;
878-
attribute_t *attribute = global::attribute::create_cluster_revision(cluster, default_cluster_revision);
884+
bool default_global_scene_control = true;
885+
attribute_t *attribute = on_off::attribute::create_global_scene_control(cluster, default_global_scene_control);
879886

880887
- command: toggle:
881888

882889
::
883890

884891
command_t *command = on_off::command::create_toggle(cluster);
885892

886-
- command: move_to_level:
887-
888-
::
889-
890-
command_t *command = level_control::command::create_move_to_level(cluster);
891-
892893
2.5.2.4 Features
893894
^^^^^^^^^^^^^^^^^^
894895
Mandatory features for a device type or endpoint can be configured at endpoint level.
@@ -899,7 +900,7 @@ Mandatory features for a device type or endpoint can be configured at endpoint l
899900

900901
extended_color_light::config_t light_config;
901902
light_config.on_off_lighting.start_up_on_off = nullptr;
902-
endpoint_t *endpoint = extended_color_light::create(node, &light_config, ENDPOINT_FLAG_NONE, nullptr);
903+
endpoint_t *endpoint = extended_color_light::create(node, &light_config, ENDPOINT_FLAG_NONE, nullptr /* priv data */);
903904

904905
Few of some mandatory feature for a cluster (i.e. cluster having O.a/O.a+ feature conformance) can be configured at cluster level.
905906
For example: Thermostat cluster has O.a+ conformance for Heating and Cooling features, that means at least one of them should be present on the thermostat cluster while creating it.
@@ -1374,10 +1375,10 @@ For example we want to use mode_select cluster in light example.
13741375

13751376
#include <static-supported-modes-manager.h>
13761377

1377-
ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
1378+
static ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager;
13781379
{
13791380
cluster::mode_select::config_t ms_config;
1380-
cluster_t *ms_cluster = cluster::mode_select::create(endpoint, &ms_config, CLUSTER_FLAG_SERVER, ESP_MATTER_NONE_FEATURE_ID);
1381+
cluster_t *ms_cluster = cluster::mode_select::create(endpoint, &ms_config, CLUSTER_FLAG_SERVER);
13811382

13821383
sStaticSupportedModesManager.InitEndpointArray(get_count(node));
13831384
ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager);

0 commit comments

Comments
 (0)