blob: 7545874a6be40a979ff007dcfa5885e6cc8d5921 [file] [log] [blame]
/*
*
* Copyright (c) 2022 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "NamedPipeCommands.h"
#include <json/json.h>
std::vector<EndpointListInfo> GetEndpointListInfo(chip::EndpointId parentId);
std::vector<Action *> GetActionListInfo(chip::EndpointId parentId);
std::vector<Room *> GetRoomListInfo(chip::EndpointId parentId);
class BridgeAppCommandHandler
{
public:
static BridgeAppCommandHandler * FromJSON(const char * json);
static void HandleCommand(intptr_t context);
BridgeAppCommandHandler(Json::Value && jasonValue) : mJsonValue(std::move(jasonValue)) {}
private:
Json::Value mJsonValue;
};
class BridgeCommandDelegate : public NamedPipeCommandDelegate
{
public:
void OnEventCommandReceived(const char * json) override;
};
// Declare runOnOffRoomAction as an external function that can be called from bridged-actions-stub.cpp
void runOnOffRoomAction(Room * room, bool actionOn, chip::EndpointId endpointId, uint16_t actionID, uint32_t invokeID,
bool hasInvokeID);