Skip to content

Commit e1738d0

Browse files
committed
Added callbacks
1 parent d049031 commit e1738d0

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

examples/refrigerator-app/silabs/src/ZclCallbacks.cpp

+54-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
*/
2222

2323
#include "AppConfig.h"
24-
2524
#include "RefrigeratorManager.h"
2625
#include <app-common/zap-generated/ids/Attributes.h>
2726
#include <app-common/zap-generated/ids/Clusters.h>
@@ -72,3 +71,57 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
7271
}
7372

7473
}
74+
75+
/** @brief Refrigerator And TemperatureControlled Cabinet Mode Cluster Init
76+
*
77+
* This function is called when a specific cluster is initialized. It gives the
78+
* application an opportunity to take care of cluster initialization procedures.
79+
* It is called exactly once for each endpoint where cluster is present.
80+
*
81+
* @param endpoint Ver.: always
82+
*
83+
*/
84+
void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterInitCallback(EndpointId endpoint) {}
85+
86+
/** @brief Refrigerator Alarm Cluster Init
87+
*
88+
* This function is called when a specific cluster is initialized. It gives the
89+
* application an opportunity to take care of cluster initialization procedures.
90+
* It is called exactly once for each endpoint where cluster is present.
91+
*
92+
* @param endpoint Ver.: always
93+
*
94+
*/
95+
void emberAfRefrigeratorAlarmClusterInitCallback(EndpointId endpoint) {}
96+
97+
/** @brief Temperature Control Cluster Init
98+
*
99+
* This function is called when a specific cluster is initialized. It gives the
100+
* application an opportunity to take care of cluster initialization procedures.
101+
* It is called exactly once for each endpoint where cluster is present.
102+
*
103+
* @param endpoint Ver.: always
104+
*
105+
*/
106+
void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) {}
107+
108+
/**
109+
* @brief Handles the SetTemperature command for the Temperature Control Cluster.
110+
*
111+
* This function is called when the SetTemperature command is received from a client.
112+
* It is responsible for setting the temperature for the cabinet as per the command data.
113+
*
114+
* @param CommandHandler commandObj Pointer to the command handler object.
115+
* @param const ConcreteCommandPath commandPath The path of the command received.
116+
* @param const DecodableType & commandData
117+
* The data decoded from the SetTemperature command, which includes the desired temperature.
118+
*
119+
* @return bool Returns true if the command was handled successfully, false otherwise.
120+
*
121+
* @note The actual implementation to set the temperature is yet to be added.
122+
*/
123+
bool emberAfTemperatureControlClusterSetTemperatureCallback(
124+
chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
125+
const chip::app::Clusters::TemperatureControl::Commands::SetTemperature::DecodableType & commandData) {
126+
// TODO: Add implementation to set the temperature for the cabinet
127+
}

0 commit comments

Comments
 (0)