pakls | b278e34 | 2022-11-07 19:11:56 +0800 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright (c) 2020 Project CHIP Authors |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | /** |
| 19 | * @file |
| 20 | * This file implements the handler for data model messages. |
| 21 | */ |
| 22 | |
| 23 | #include "AppConfig.h" |
| 24 | |
| 25 | #include <app-common/zap-generated/ids/Attributes.h> |
| 26 | #include <app-common/zap-generated/ids/Clusters.h> |
| 27 | #include <app/ConcreteAttributePath.h> |
| 28 | #include <lib/support/logging/CHIPLogging.h> |
| 29 | |
| 30 | using namespace ::chip; |
| 31 | using namespace ::chip::app::Clusters; |
| 32 | |
| 33 | void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, |
| 34 | uint8_t * value) |
| 35 | { |
| 36 | ClusterId clusterId = attributePath.mClusterId; |
| 37 | AttributeId attributeId = attributePath.mAttributeId; |
| 38 | ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); |
| 39 | |
| 40 | if (clusterId == Identify::Id) |
| 41 | { |
| 42 | ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", |
| 43 | ChipLogValueMEI(attributeId), type, *value, size); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | /** @brief OnOff Cluster Init |
| 48 | * |
| 49 | * This function is called when a specific cluster is initialized. It gives the |
| 50 | * application an opportunity to take care of cluster initialization procedures. |
| 51 | * It is called exactly once for each endpoint where cluster is present. |
| 52 | * |
| 53 | * @param endpoint Ver.: always |
| 54 | * |
| 55 | * TODO Issue #3841 |
| 56 | * emberAfOnOffClusterInitCallback happens before the stack initialize the cluster |
| 57 | * attributes to the default value. |
| 58 | * The logic here expects something similar to the deprecated Plugins callback |
| 59 | * emberAfPluginOnOffClusterServerPostInitCallback. |
| 60 | * |
| 61 | */ |
| 62 | void emberAfOnOffClusterInitCallback(EndpointId endpoint) |
| 63 | { |
| 64 | // TODO: implement any additional Cluster Server init actions |
| 65 | } |