2 * Copyright (c) 2020 Project CHIP Authors
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include "../../config/PersistentStorage.h"
28 using NodeId = ::chip::NodeId;
29 using CommandsVector = ::std::vector<std::unique_ptr<Command>>;
31 void Register(const char * clusterName, commands_list commandsList);
32 int Run(NodeId localId, NodeId remoteId, int argc, char ** argv);
35 CHIP_ERROR RunCommand(PersistentStorage & storage, NodeId localId, NodeId remoteId, int argc, char ** argv);
36 std::map<std::string, CommandsVector>::iterator GetCluster(std::string clusterName);
37 Command * GetCommand(CommandsVector & commands, std::string commandName);
38 Command * GetGlobalCommand(CommandsVector & commands, std::string commandName, std::string attributeName);
39 bool IsGlobalCommand(std::string commandName) const;
41 void ShowClusters(std::string executable);
42 void ShowCluster(std::string executable, std::string clusterName, CommandsVector & commands);
43 void ShowClusterAttributes(std::string executable, std::string clusterName, std::string commandName, CommandsVector & commands);
44 void ShowCommand(std::string executable, std::string clusterName, Command * command);
46 std::map<std::string, CommandsVector> mClusters;