From 0e22bb4bac0a65719ea56d82ddb4d0b1eee71fd9 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 16 Dec 2024 10:58:49 -0300 Subject: [PATCH] feat(matter): moved all identify callback to endpoint.h --- .../MatterOnIdentify/MatterOnIdentify.ino | 34 ++++++++++--------- libraries/Matter/src/MatterEndPoint.h | 15 +++++++- .../src/MatterEndpoints/MatterColorLight.h | 13 ------- .../MatterColorTemperatureLight.h | 14 -------- .../src/MatterEndpoints/MatterContactSensor.h | 13 ------- .../src/MatterEndpoints/MatterDimmableLight.h | 13 ------- .../MatterEnhancedColorLight.h | 13 ------- .../Matter/src/MatterEndpoints/MatterFan.h | 13 ------- .../src/MatterEndpoints/MatterGenericSwitch.h | 13 ------- .../MatterEndpoints/MatterHumiditySensor.h | 13 ------- .../MatterEndpoints/MatterOccupancySensor.h | 13 ------- .../src/MatterEndpoints/MatterOnOffLight.h | 13 ------- .../src/MatterEndpoints/MatterOnOffPlugin.h | 13 ------- .../MatterEndpoints/MatterPressureSensor.h | 13 ------- .../MatterEndpoints/MatterTemperatureSensor.h | 13 ------- 15 files changed, 32 insertions(+), 187 deletions(-) diff --git a/libraries/Matter/examples/MatterOnIdentify/MatterOnIdentify.ino b/libraries/Matter/examples/MatterOnIdentify/MatterOnIdentify.ino index f55a20ae3..9b183e0b1 100644 --- a/libraries/Matter/examples/MatterOnIdentify/MatterOnIdentify.ino +++ b/libraries/Matter/examples/MatterOnIdentify/MatterOnIdentify.ino @@ -32,6 +32,10 @@ // Single On/Off Light Endpoint - at least one per node MatterOnOffLight OnOffLight; +// WiFi is manually set and started +const char *ssid = "your-ssid"; // Change this to your WiFi SSID +const char *password = "your-password"; // Change this to your WiFi password + // Light GPIO that can be controlled by Matter APP #ifdef LED_BUILTIN const uint8_t ledPin = LED_BUILTIN; @@ -48,15 +52,23 @@ bool button_state = false; // false = released | true = pres const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission // Matter Protocol Endpoint (On/OFF Light) Callback -bool matterCB(bool state) { +bool onOffLightCallback(bool state) { digitalWrite(ledPin, state ? HIGH : LOW); // This callback must return the success state to Matter core return true; } -// WiFi is manually set and started -const char *ssid = "your-ssid"; // Change this to your WiFi SSID -const char *password = "your-password"; // Change this to your WiFi password +bool onIdentifyLightCallback(bool identifyIsActive, uint8_t counter) { + log_i("Identify Cluster is %s, counter: %d", identifyIsActive ? "Active" : "Inactive", counter); + if (identifyIsActive) { + // Start Blinking the light + OnOffLight.toggle(); + } else { + // Stop Blinking and restore the light to the its last state + OnOffLight.updateAccessory(); + } + return true; +} void setup() { // Initialize the USER BUTTON (Boot button) that will be used to decommission the Matter Node @@ -75,20 +87,10 @@ void setup() { OnOffLight.begin(); // On Identify Callback - Blink the LED - OnOffLight.onIdentify([](bool identifyIsActive, uint8_t counter) { - log_i("Identify Cluster is %s, counter: %d", identifyIsActive ? "Active" : "Inactive", counter); - if (identifyIsActive) { - // Start Blinking the light - OnOffLight.toggle(); - } else { - // Stop Blinking and restore the light to the its last state - OnOffLight.updateAccessory(); - } - return true; - }); + OnOffLight.onIdentify(onIdentifyLightCallback); // Associate a callback to the Matter Controller - OnOffLight.onChange(matterCB); + OnOffLight.onChange(onOffLightCallback); // Matter beginning - Last step, after all EndPoints are initialized Matter.begin(); diff --git a/libraries/Matter/src/MatterEndPoint.h b/libraries/Matter/src/MatterEndPoint.h index 7f791ff49..34b59bb18 100644 --- a/libraries/Matter/src/MatterEndPoint.h +++ b/libraries/Matter/src/MatterEndPoint.h @@ -103,8 +103,21 @@ public: virtual bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val) = 0; // This callback is invoked when clients interact with the Identify Cluster of an specific endpoint. - virtual bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) = 0; + bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { + if (_onEndPointIdentifyCB) { + return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); + } + return true; + } + // User callaback for the Identify Cluster functionality + using EndPointIdentifyCB = std::function; + void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { + _onEndPointIdentifyCB = onEndPointIdentifyCB; + } + + protected: uint16_t endpoint_id = 0; + EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterColorLight.h b/libraries/Matter/src/MatterEndpoints/MatterColorLight.h index f579d5550..13ff0decb 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterColorLight.h +++ b/libraries/Matter/src/MatterEndpoints/MatterColorLight.h @@ -46,18 +46,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } // User Callback for whenever the Light On/Off state is changed by the Matter Controller using EndPointOnOffCB = std::function; @@ -83,6 +71,5 @@ protected: EndPointOnOffCB _onChangeOnOffCB = NULL; EndPointRGBColorCB _onChangeColorCB = NULL; EndPointCB _onChangeCB = NULL; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.h b/libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.h index de51be4a2..e886a1841 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.h +++ b/libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.h @@ -51,18 +51,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } // User Callback for whenever the Light On/Off state is changed by the Matter Controller using EndPointOnOffCB = std::function; @@ -97,7 +85,5 @@ protected: EndPointBrightnessCB _onChangeBrightnessCB = NULL; EndPointTemperatureCB _onChangeTemperatureCB = NULL; EndPointCB _onChangeCB = NULL; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; - }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterContactSensor.h b/libraries/Matter/src/MatterEndpoints/MatterContactSensor.h index c4e74d6c3..257da785e 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterContactSensor.h +++ b/libraries/Matter/src/MatterEndpoints/MatterContactSensor.h @@ -46,22 +46,9 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } protected: bool started = false; bool contactState = false; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterDimmableLight.h b/libraries/Matter/src/MatterEndpoints/MatterDimmableLight.h index aeb85fae2..838fe3647 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterDimmableLight.h +++ b/libraries/Matter/src/MatterEndpoints/MatterDimmableLight.h @@ -46,18 +46,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } // User Callback for whenever the Light On/Off state is changed by the Matter Controller using EndPointOnOffCB = std::function; @@ -83,6 +71,5 @@ protected: EndPointOnOffCB _onChangeOnOffCB = NULL; EndPointBrightnessCB _onChangeBrightnessCB = NULL; EndPointCB _onChangeCB = NULL; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.h b/libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.h index 599ae55ff..66ed1943b 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.h +++ b/libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.h @@ -56,18 +56,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } // User Callback for whenever the Light On/Off state is changed by the Matter Controller using EndPointOnOffCB = std::function; @@ -110,6 +98,5 @@ protected: EndPointRGBColorCB _onChangeColorCB = NULL; EndPointTemperatureCB _onChangeTemperatureCB = NULL; EndPointCB _onChangeCB = NULL; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterFan.h b/libraries/Matter/src/MatterEndpoints/MatterFan.h index ba8772fd1..232577b7b 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterFan.h +++ b/libraries/Matter/src/MatterEndpoints/MatterFan.h @@ -105,18 +105,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } // User Callback for whenever the Fan Mode (state) is changed by the Matter Controller using EndPointModeCB = std::function; @@ -145,7 +133,6 @@ protected: EndPointModeCB _onChangeModeCB = NULL; EndPointSpeedCB _onChangeSpeedCB = NULL; EndPointCB _onChangeCB = NULL; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; // bitmap for Fan Sequence Modes (OFF, LOW, MEDIUM, HIGH, AUTO) static const uint8_t fanSeqModeOff = 0x01; diff --git a/libraries/Matter/src/MatterEndpoints/MatterGenericSwitch.h b/libraries/Matter/src/MatterEndpoints/MatterGenericSwitch.h index 895413f2f..141184629 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterGenericSwitch.h +++ b/libraries/Matter/src/MatterEndpoints/MatterGenericSwitch.h @@ -32,21 +32,8 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } protected: bool started = false; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.h b/libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.h index 7268947d1..aed758b7b 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.h +++ b/libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.h @@ -57,18 +57,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } protected: bool started = false; @@ -77,6 +65,5 @@ protected: // internal function to set the raw humidity value (Matter Cluster) bool begin(uint16_t _rawHumidity); bool setRawHumidity(uint16_t _rawHumidity); - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.h b/libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.h index 61d4ad1bc..30f312a98 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.h +++ b/libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.h @@ -57,18 +57,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } protected: // bitmap for Occupancy Sensor Types @@ -81,6 +69,5 @@ protected: bool started = false; bool occupancyState = false; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterOnOffLight.h b/libraries/Matter/src/MatterEndpoints/MatterOnOffLight.h index 4b1b5e4ea..b27a25300 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterOnOffLight.h +++ b/libraries/Matter/src/MatterEndpoints/MatterOnOffLight.h @@ -39,18 +39,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } // User Callback for whenever the Light state is changed by the Matter Controller using EndPointCB = std::function; @@ -66,6 +54,5 @@ protected: bool onOffState = false; // default initial state is off, but it can be changed by begin(bool) EndPointCB _onChangeCB = NULL; EndPointCB _onChangeOnOffCB = NULL; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.h b/libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.h index cf733f4c4..0b66be6c1 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.h +++ b/libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.h @@ -39,18 +39,6 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } // User Callback for whenever the Plugin state is changed by the Matter Controller using EndPointCB = std::function; @@ -66,6 +54,5 @@ protected: bool onOffState = false; // default initial state is off, but it can be changed by begin(bool) EndPointCB _onChangeCB = NULL; EndPointCB _onChangeOnOffCB = NULL; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; }; #endif /* CONFIG_ESP_MATTER_ENABLE_DATA_MODEL */ diff --git a/libraries/Matter/src/MatterEndpoints/MatterPressureSensor.h b/libraries/Matter/src/MatterEndpoints/MatterPressureSensor.h index 8ff4446c6..9fdd90c6e 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterPressureSensor.h +++ b/libraries/Matter/src/MatterEndpoints/MatterPressureSensor.h @@ -50,24 +50,11 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } protected: bool started = false; // implementation keeps pressure in hPa int16_t rawPressure = 0; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; // internal function to set the raw pressure value (Matter Cluster) bool setRawPressure(int16_t _rawPressure); bool begin(int16_t _rawPressure); diff --git a/libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.h b/libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.h index cb50dc0ff..826abac9a 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.h +++ b/libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.h @@ -51,24 +51,11 @@ public: // this function is called by Matter internal event processor. It could be overwritten by the application, if necessary. bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val); - // this function is invoked when clients interact with the Identify Cluster of an specific endpoint - bool endpointIdentifyCB(uint16_t endpoint_id, bool identifyIsEnabled, uint8_t identifyCounter) { - if (_onEndPointIdentifyCB) { - return _onEndPointIdentifyCB(identifyIsEnabled, identifyCounter); - } - return true; - } - // User callaback for the Identify Cluster functionality - using EndPointIdentifyCB = std::function; - void onIdentify(EndPointIdentifyCB onEndPointIdentifyCB) { - _onEndPointIdentifyCB = onEndPointIdentifyCB; - } protected: bool started = false; // implementation keeps temperature in 1/100th of a degree, any temperature unit int16_t rawTemperature = 0; - EndPointIdentifyCB _onEndPointIdentifyCB = NULL; // internal function to set the raw temperature value (Matter Cluster) bool setRawTemperature(int16_t _rawTemperature); bool begin(int16_t _rawTemperature);