Skip to content

Commit 9be01e2

Browse files
committed
Modified the datat type and the removed the callback
1 parent e1738d0 commit 9be01e2

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

examples/refrigerator-app/silabs/include/RefrigeratorManager.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ class RefrigeratorManager
6262
private:
6363
friend RefrigeratorManager & RefrigeratorMgr();
6464

65-
uint8_t mCurrentMode;
66-
uint8_t mStartUpMode;
67-
uint8_t mOnMode;
65+
int16_t mCurrentMode;
66+
int16_t mStartUpMode;
67+
int16_t mOnMode;
6868

6969
int16_t mTemperatureSetpoint;
7070
int16_t mMinTemperature;

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

+10-9
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "AppEvent.h"
2828
#include "AppTask.h"
2929
#include <app-common/zap-generated/attributes/Accessors.h>
30+
#include <lib/support/logging/CHIPLogging.h>
3031

3132

3233
/**********************************************************
@@ -100,19 +101,19 @@ void RefrigeratorManager::RefAndTempCtrlAttributeChangeHandler(EndpointId endpoi
100101
switch (attributeId)
101102
{
102103
case RefAndTempAttr::CurrentMode::Id: {
103-
int8_t currentMode = static_cast<int16_t>(*value);
104+
int16_t currentMode = static_cast<int16_t>(*value);
104105
mCurrentMode = currentMode;
105106
}
106107
break;
107108

108109
case RefAndTempAttr::StartUpMode::Id: {
109-
int8_t startUpMode = static_cast<int16_t>(*value);
110+
int16_t startUpMode = static_cast<int16_t>(*value);
110111
mStartUpMode = startUpMode;
111112
}
112113
break;
113114

114115
case RefAndTempAttr::OnMode::Id: {
115-
int8_t onMode = static_cast<int16_t>(*value);
116+
int16_t onMode = static_cast<int16_t>(*value);
116117
mOnMode = onMode;
117118
}
118119
break;
@@ -176,22 +177,22 @@ void RefrigeratorManager::RefAlaramAttributeChangeHandler(EndpointId endpointId,
176177
switch (attributeId)
177178
{
178179
case RefAlarmAttr::Mask::Id: {
179-
int8_t mask = static_cast<uint32_t>(*value);
180-
mMask = mask;
180+
auto mask = static_cast<uint32_t>(*value);
181+
mState = static_cast<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>(mask);
181182
RefAlarmAttr::Mask::Set(endpointId, mMask);
182183
}
183184
break;
184185

185186
case RefAlarmAttr::State::Id: {
186-
int8_t state = static_cast<uint32_t>(*value);
187-
mState = state;
187+
auto state = static_cast<uint32_t>(*value);
188+
mState = static_cast<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>(state);
188189
RefAlarmAttr::State::Set(endpointId, mState);
189190
}
190191
break;
191192

192193
case RefAlarmAttr::Supported::Id: {
193-
int8_t supported = static_cast<uint32_t>(*value);
194-
mSupported = supported;
194+
auto supported = static_cast<uint32_t>(*value);
195+
mSupported = static_cast<chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap>(supported);
195196
RefAlarmAttr::Supported::Set(endpointId, mSupported);
196197
}
197198
break;

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

+21-20
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,24 @@ void emberAfRefrigeratorAlarmClusterInitCallback(EndpointId endpoint) {}
105105
*/
106106
void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) {}
107107

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-
}
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+
// return true;
128+
// }

0 commit comments

Comments
 (0)