Apply Upstream code (2021-03-15)
[platform/upstream/connectedhomeip.git] / examples / temperature-measurement-app / esp32 / main / gen / IMClusterCommandHandler.cpp
1 /*
2  *
3  *    Copyright (c) 2021 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 // THIS FILE IS GENERATED BY ZAP
19
20 #include <cinttypes>
21 #include <cstdint>
22
23 #include "af-structs.h"
24 #include "call-command-handler.h"
25 #include "callback.h"
26 #include "cluster-id.h"
27 #include "command-id.h"
28 #include "util.h"
29
30 #include <app/InteractionModelEngine.h>
31
32 // Currently we need some work to keep compatible with ember lib.
33 #include <util/ember-compatibility-functions.h>
34
35 namespace chip {
36 namespace app {
37
38 // Cluster specific command parsing
39
40 namespace clusters {
41
42 } // namespace clusters
43
44 void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId,
45                                   chip::TLV::TLVReader & aReader, Command * apCommandObj)
46 {
47     ChipLogDetail(Zcl, "Received Cluster Command: Cluster=%" PRIx16 " Command=%" PRIx8 " Endpoint=%" PRIx8, aClusterId, aCommandId,
48                   aEndPointId);
49     Compatibility::SetupEmberAfObjects(apCommandObj, aClusterId, aCommandId, aEndPointId);
50     switch (aClusterId)
51     {
52     default:
53         // Unrecognized cluster ID, error status will apply.
54         // TODO: Encode response for Cluster not found
55         ChipLogError(Zcl, "Unknown cluster %" PRIx16, aClusterId);
56         break;
57     }
58     Compatibility::ResetEmberAfObjects();
59 }
60
61 } // namespace app
62 } // namespace chip