Skip to content

Commit

Permalink
add impl for boundry checks for thermostat-user-interface-configurati…
Browse files Browse the repository at this point in the history
…on in all-clsuter-app
  • Loading branch information
Dimitri Mizenko committed Oct 27, 2021
1 parent c6ca099 commit 30fc7fe
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/all-clusters-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@
* limitations under the License.
*/

#include <app-common/zap-generated/callback.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/Command.h>
#include <app/ConcreteAttributePath.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/util/af.h>

#include "AppMain.h"

using namespace chip;

bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj)
{
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
Expand All @@ -42,6 +47,22 @@ Identify gIdentify1 = {
EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED,
};

Protocols::InteractionModel::Status MatterPreAttributeChangeCallback(const app::ConcreteAttributePath & attributePath, uint8_t mask,
uint8_t type, uint16_t size, uint8_t * value)
{
Protocols::InteractionModel::Status status = Protocols::InteractionModel::Status::Success;
if (attributePath.mClusterId == app::Clusters::Thermostat::Id)
{
status = MatterThermostatClusterServerPreAttributeChangedCallback(attributePath, type, size, value);
}
else if (attributePath.mClusterId == app::Clusters::ThermostatUserInterfaceConfiguration::Id)
{
status =
MatterThermostatUserInterfaceConfigurationClusterServerPreAttributeChangedCallback(attributePath, type, size, value);
}
return status;
}

int main(int argc, char * argv[])
{
VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0);
Expand Down

0 comments on commit 30fc7fe

Please sign in to comment.