mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Change return type of add() API to esp_err from endpoint.
This commit is contained in:
@@ -86,6 +86,15 @@ Features
|
|||||||
- RainMaker integration.
|
- RainMaker integration.
|
||||||
- Zigbee to Matter and BLE Mesh to Matter Bridge.
|
- Zigbee to Matter and BLE Mesh to Matter Bridge.
|
||||||
|
|
||||||
|
# 25-Sep-2023
|
||||||
|
|
||||||
|
API Change
|
||||||
|
|
||||||
|
```
|
||||||
|
esp_err_t add(endpoint_t *endpoint, config_t *config)
|
||||||
|
```
|
||||||
|
- Above API returns the esp_err instread of endpoint.
|
||||||
|
|
||||||
Known Issues
|
Known Issues
|
||||||
------------
|
------------
|
||||||
- BLE memory is not freed if the device has already been commissioned on bootup.
|
- BLE memory is not freed if the device has already been commissioned on bootup.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -115,7 +115,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* root_node */
|
} /* root_node */
|
||||||
|
|
||||||
namespace power_source_device{
|
namespace power_source_device{
|
||||||
@@ -127,7 +127,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* power_source_device */
|
} /* power_source_device */
|
||||||
|
|
||||||
namespace on_off_light {
|
namespace on_off_light {
|
||||||
@@ -142,7 +142,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* on_off_light */
|
} /* on_off_light */
|
||||||
|
|
||||||
namespace dimmable_light {
|
namespace dimmable_light {
|
||||||
@@ -158,7 +158,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* dimmable_light */
|
} /* dimmable_light */
|
||||||
|
|
||||||
namespace color_temperature_light {
|
namespace color_temperature_light {
|
||||||
@@ -175,7 +175,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* color_temperature_light */
|
} /* color_temperature_light */
|
||||||
|
|
||||||
namespace extended_color_light {
|
namespace extended_color_light {
|
||||||
@@ -192,7 +192,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* extended_color_light */
|
} /* extended_color_light */
|
||||||
|
|
||||||
namespace on_off_switch {
|
namespace on_off_switch {
|
||||||
@@ -205,7 +205,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* on_off_switch */
|
} /* on_off_switch */
|
||||||
|
|
||||||
namespace dimmer_switch {
|
namespace dimmer_switch {
|
||||||
@@ -218,7 +218,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* dimmer_switch */
|
} /* dimmer_switch */
|
||||||
|
|
||||||
namespace color_dimmer_switch {
|
namespace color_dimmer_switch {
|
||||||
@@ -231,7 +231,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* color_dimmer_switch */
|
} /* color_dimmer_switch */
|
||||||
|
|
||||||
namespace generic_switch {
|
namespace generic_switch {
|
||||||
@@ -244,7 +244,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* generic_switch */
|
} /* generic_switch */
|
||||||
|
|
||||||
namespace on_off_plugin_unit {
|
namespace on_off_plugin_unit {
|
||||||
@@ -259,7 +259,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* on_off_plugin_unit */
|
} /* on_off_plugin_unit */
|
||||||
|
|
||||||
namespace dimmable_plugin_unit {
|
namespace dimmable_plugin_unit {
|
||||||
@@ -275,7 +275,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* dimmable_plugin_unit */
|
} /* dimmable_plugin_unit */
|
||||||
|
|
||||||
namespace fan {
|
namespace fan {
|
||||||
@@ -289,7 +289,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* fan */
|
} /* fan */
|
||||||
|
|
||||||
namespace thermostat {
|
namespace thermostat {
|
||||||
@@ -304,7 +304,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* thermostat */
|
} /* thermostat */
|
||||||
|
|
||||||
namespace aggregator {
|
namespace aggregator {
|
||||||
@@ -315,7 +315,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* aggregator */
|
} /* aggregator */
|
||||||
|
|
||||||
namespace bridged_node {
|
namespace bridged_node {
|
||||||
@@ -327,7 +327,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
endpoint_t *resume(node_t *node, config_t *config, uint8_t flags, uint16_t endpoint_id, void *priv_data);
|
endpoint_t *resume(node_t *node, config_t *config, uint8_t flags, uint16_t endpoint_id, void *priv_data);
|
||||||
} /* bridged_node */
|
} /* bridged_node */
|
||||||
|
|
||||||
@@ -341,7 +341,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* door_lock */
|
} /* door_lock */
|
||||||
|
|
||||||
namespace window_covering_device {
|
namespace window_covering_device {
|
||||||
@@ -357,7 +357,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* window_covering */
|
} /* window_covering */
|
||||||
|
|
||||||
namespace temperature_sensor {
|
namespace temperature_sensor {
|
||||||
@@ -370,7 +370,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* temperature_sensor */
|
} /* temperature_sensor */
|
||||||
|
|
||||||
namespace humidity_sensor {
|
namespace humidity_sensor {
|
||||||
@@ -383,7 +383,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* humidity_sensor */
|
} /* humidity_sensor */
|
||||||
|
|
||||||
namespace occupancy_sensor {
|
namespace occupancy_sensor {
|
||||||
@@ -396,7 +396,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* occupancy_sensor */
|
} /* occupancy_sensor */
|
||||||
|
|
||||||
namespace contact_sensor {
|
namespace contact_sensor {
|
||||||
@@ -409,7 +409,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* contact_sensor */
|
} /* contact_sensor */
|
||||||
|
|
||||||
namespace light_sensor {
|
namespace light_sensor {
|
||||||
@@ -422,7 +422,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* light_sensor */
|
} /* light_sensor */
|
||||||
|
|
||||||
namespace pressure_sensor {
|
namespace pressure_sensor {
|
||||||
@@ -435,7 +435,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* pressure_sensor */
|
} /* pressure_sensor */
|
||||||
|
|
||||||
namespace flow_sensor {
|
namespace flow_sensor {
|
||||||
@@ -448,7 +448,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /* flow_sensor */
|
} /* flow_sensor */
|
||||||
|
|
||||||
namespace pump{
|
namespace pump{
|
||||||
@@ -467,7 +467,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /** pump **/
|
} /** pump **/
|
||||||
|
|
||||||
namespace mode_select_device {
|
namespace mode_select_device {
|
||||||
@@ -479,7 +479,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /** mode_select_device **/
|
} /** mode_select_device **/
|
||||||
|
|
||||||
namespace room_air_conditioner{
|
namespace room_air_conditioner{
|
||||||
@@ -493,7 +493,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /** room air conditioner **/
|
} /** room air conditioner **/
|
||||||
|
|
||||||
namespace temperature_controlled_cabinet{
|
namespace temperature_controlled_cabinet{
|
||||||
@@ -505,7 +505,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /** temperature_controlled_cabinet **/
|
} /** temperature_controlled_cabinet **/
|
||||||
|
|
||||||
namespace refrigerator{
|
namespace refrigerator{
|
||||||
@@ -516,7 +516,7 @@ typedef struct config {
|
|||||||
uint32_t get_device_type_id();
|
uint32_t get_device_type_id();
|
||||||
uint8_t get_device_type_version();
|
uint8_t get_device_type_version();
|
||||||
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
|
||||||
endpoint_t *add(endpoint_t *endpoint, config_t *config);
|
esp_err_t add(endpoint_t *endpoint, config_t *config);
|
||||||
} /** refrigerator **/
|
} /** refrigerator **/
|
||||||
|
|
||||||
} /* endpoint */
|
} /* endpoint */
|
||||||
|
|||||||
@@ -182,31 +182,51 @@ esp_err_t set_device_type(device_t *bridged_device, uint32_t device_type_id)
|
|||||||
ESP_LOGE(TAG, "bridged_device cannot be NULL");
|
ESP_LOGE(TAG, "bridged_device cannot be NULL");
|
||||||
return ESP_ERR_INVALID_ARG;
|
return ESP_ERR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
|
esp_err_t err = ESP_OK;
|
||||||
switch (device_type_id) {
|
switch (device_type_id) {
|
||||||
case ESP_MATTER_ON_OFF_LIGHT_DEVICE_TYPE_ID: {
|
case ESP_MATTER_ON_OFF_LIGHT_DEVICE_TYPE_ID: {
|
||||||
on_off_light::config_t on_off_light_conf;
|
on_off_light::config_t on_off_light_conf;
|
||||||
bridged_device->endpoint = on_off_light::add(bridged_device->endpoint, &on_off_light_conf);
|
err = on_off_light::add(bridged_device->endpoint, &on_off_light_conf);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Failed to add device type");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_MATTER_DIMMABLE_LIGHT_DEVICE_TYPE_ID: {
|
case ESP_MATTER_DIMMABLE_LIGHT_DEVICE_TYPE_ID: {
|
||||||
dimmable_light::config_t dimmable_light_conf;
|
dimmable_light::config_t dimmable_light_conf;
|
||||||
bridged_device->endpoint = dimmable_light::add(bridged_device->endpoint, &dimmable_light_conf);
|
err = dimmable_light::add(bridged_device->endpoint, &dimmable_light_conf);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Failed to add device type");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_MATTER_COLOR_TEMPERATURE_LIGHT_DEVICE_TYPE_ID: {
|
case ESP_MATTER_COLOR_TEMPERATURE_LIGHT_DEVICE_TYPE_ID: {
|
||||||
color_temperature_light::config_t color_temperature_light_conf;
|
color_temperature_light::config_t color_temperature_light_conf;
|
||||||
bridged_device->endpoint =
|
err = color_temperature_light::add(bridged_device->endpoint, &color_temperature_light_conf);
|
||||||
color_temperature_light::add(bridged_device->endpoint, &color_temperature_light_conf);
|
if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Failed to add device type");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_MATTER_EXTENDED_COLOR_LIGHT_DEVICE_TYPE_ID: {
|
case ESP_MATTER_EXTENDED_COLOR_LIGHT_DEVICE_TYPE_ID: {
|
||||||
extended_color_light::config_t extended_color_light_conf;
|
extended_color_light::config_t extended_color_light_conf;
|
||||||
bridged_device->endpoint = extended_color_light::add(bridged_device->endpoint, &extended_color_light_conf);
|
err = extended_color_light::add(bridged_device->endpoint, &extended_color_light_conf);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Failed to add device type");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_MATTER_ON_OFF_SWITCH_DEVICE_TYPE_ID: {
|
case ESP_MATTER_ON_OFF_SWITCH_DEVICE_TYPE_ID: {
|
||||||
on_off_switch::config_t switch_config;
|
on_off_switch::config_t switch_config;
|
||||||
bridged_device->endpoint = on_off_switch::add(bridged_device->endpoint, &switch_config);
|
err = on_off_switch::add(bridged_device->endpoint, &switch_config);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Failed to add device type");
|
||||||
|
return err;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|||||||
Reference in New Issue
Block a user