Merge branch 'mock_delegates_1' into 'main'

all-device-types-app: Add empty mock delegates for the clusters.

See merge request app-frameworks/esp-matter!1221
This commit is contained in:
Hrishikesh Dhayagude
2026-03-03 13:57:02 +08:00
102 changed files with 6799 additions and 19 deletions
@@ -36,6 +36,22 @@
#include <clusters/soil_measurement/integration.h>
#include "electrical_measurement/electrical_measurement.h"
#include "mock_delegates/mock_chime_delegate.h"
#include "mock_delegates/mock_thermostat_delegate.h"
#include "mock_delegates/mock_door_lock_delegate.h"
#include "mock_delegates/mock_window_covering_delegate.h"
#include "mock_delegates/mock_valve_configuration_and_control_delegate.h"
#include "mock_delegates/mock_water_heater_management_delegate.h"
#include "mock_delegates/mock_microwave_oven_control_delegate.h"
#include "mock_delegates/mock_operational_state_delegate.h"
#include "mock_delegates/mock_energy_evse_delegate.h"
#include "mock_delegates/mock_electrical_power_measurement_delegate.h"
#include "mock_delegates/mock_mode_base_delegate.h"
#include "mock_delegates/mock_fan_control_delegate.h"
#include "mock_delegates/mock_closure_control_delegate.h"
#include "mock_delegates/mock_closure_dimension_delegate.h"
#include "mock_delegates/mock_device_energy_management_delegate.h"
#include "mock_delegates/mock_commodity_price_delegate.h"
#include "mock_delegates/mock_commodity_tariff_delegate.h"
// External variables for electrical sensor initialization
bool g_electrical_sensor_created = false;
@@ -174,9 +190,6 @@ static void initialize_console(void)
namespace esp_matter {
static chip::app::Clusters::PowerTopology::PowerTopologyDelegate powerTopologyDelegate;
static chip::app::Clusters::Chime::MockChimeDelegate chimeDelegate;
namespace data_model {
int create(uint8_t device_type_index)
@@ -270,6 +283,8 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_THERMOSTAT: {
esp_matter::endpoint::thermostat::config_t thermostat_config;
static chip::app::Clusters::Thermostat::MockThermostatDelegate thermostatDelegate;
thermostat_config.thermostat.delegate = &thermostatDelegate;
thermostat_config.thermostat.feature_flags = cluster::thermostat::feature::auto_mode::get_id();
endpoint = esp_matter::endpoint::thermostat::create(node, &thermostat_config, ENDPOINT_FLAG_NONE, NULL);
break;
@@ -291,17 +306,15 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_DOOR_LOCK: {
esp_matter::endpoint::door_lock::config_t door_lock_config;
static chip::app::Clusters::DoorLock::MockDoorLockDelegate doorLockDelegate;
door_lock_config.door_lock.delegate = &doorLockDelegate;
endpoint = esp_matter::endpoint::door_lock::create(node, &door_lock_config, ENDPOINT_FLAG_NONE, NULL);
cluster_t *door_lock_cluster = cluster::get(endpoint, chip::app::Clusters::DoorLock::Id);
VerifyOrReturnError(door_lock_cluster, ESP_ERR_INVALID_STATE, ESP_LOGE(TAG, "Failed to get door lock cluster"));
cluster::door_lock::feature::pin_credential::config_t pin_credential_config;
cluster::door_lock::feature::user::config_t user_config;
cluster::door_lock::feature::pin_credential::add(door_lock_cluster, &pin_credential_config);
cluster::door_lock::feature::user::add(door_lock_cluster, &user_config);
break;
}
case ESP_MATTER_WINDOW_COVERING_DEVICE: {
esp_matter::endpoint::window_covering::config_t window_covering_config;
static chip::app::Clusters::WindowCovering::MockWindowCoveringDelegate windowCoveringDelegate;
window_covering_config.window_covering.delegate = &windowCoveringDelegate;
window_covering_config.window_covering.feature_flags = cluster::window_covering::feature::lift::get_id();
endpoint = esp_matter::endpoint::window_covering::create(node, &window_covering_config, ENDPOINT_FLAG_NONE, NULL);
cluster_t *cluster = cluster::get(endpoint, chip::app::Clusters::WindowCovering::Id);
@@ -358,11 +371,15 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_MODE_SELECT_DEVICE: {
esp_matter::endpoint::mode_select::config_t mode_select_config;
static chip::app::Clusters::ModeBase::MockModeBaseDelegate modeSelectDelegate;
mode_select_config.mode_select.delegate = &modeSelectDelegate;
endpoint = esp_matter::endpoint::mode_select::create(node, &mode_select_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
case ESP_MATTER_RAC: {
esp_matter::endpoint::room_air_conditioner::config_t room_air_conditioner_config;
static chip::app::Clusters::Thermostat::MockThermostatDelegate racThermostatDelegate;
room_air_conditioner_config.thermostat.delegate = &racThermostatDelegate;
room_air_conditioner_config.thermostat.feature_flags = cluster::thermostat::feature::cooling::get_id();
endpoint = esp_matter::endpoint::room_air_conditioner::create(node, &room_air_conditioner_config, ENDPOINT_FLAG_NONE, NULL);
break;
@@ -404,6 +421,8 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_AIR_PURIFIER: {
esp_matter::endpoint::air_purifier::config_t air_purifier_config;
static chip::app::Clusters::FanControl::MockFanControlDelegate airPurifierFanDelegate;
air_purifier_config.fan_control.delegate = &airPurifierFanDelegate;
endpoint = esp_matter::endpoint::air_purifier::create(node, &air_purifier_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
@@ -414,16 +433,22 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_ROBOTIC_VACUUM_CLEANER: {
esp_matter::endpoint::robotic_vacuum_cleaner::config_t robotic_vacuum_cleaner_config;
static chip::app::Clusters::ModeBase::MockModeBaseDelegate rvcRunModeDelegate;
robotic_vacuum_cleaner_config.rvc_run_mode.delegate = &rvcRunModeDelegate;
endpoint = esp_matter::endpoint::robotic_vacuum_cleaner::create(node, &robotic_vacuum_cleaner_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
case ESP_MATTER_LAUNDRY_WASHER: {
esp_matter::endpoint::laundry_washer::config_t laundry_washer_config;
static chip::app::Clusters::OperationalState::MockOperationalStateDelegate laundryWasherOpStateDelegate;
laundry_washer_config.operational_state.delegate = &laundryWasherOpStateDelegate;
endpoint = esp_matter::endpoint::laundry_washer::create(node, &laundry_washer_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
case ESP_MATTER_DISH_WASHER: {
esp_matter::endpoint::dish_washer::config_t dish_washer_config;
static chip::app::Clusters::OperationalState::MockOperationalStateDelegate dishWasherOpStateDelegate;
dish_washer_config.operational_state.delegate = &dishWasherOpStateDelegate;
endpoint = esp_matter::endpoint::dish_washer::create(node, &dish_washer_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
@@ -465,11 +490,14 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_ELECTRICAL_SENSOR: {
esp_matter::endpoint::electrical_sensor::config_t electrical_sensor_config;
static chip::app::Clusters::PowerTopology::PowerTopologyDelegate powerTopologyDelegate;
static chip::app::Clusters::ElectricalPowerMeasurement::MockElectricalPowerMeasurementDelegate electricalPowerMeasurementDelegate;
electrical_sensor_config.power_topology.feature_flags = esp_matter::cluster::power_topology::feature::set_topology::get_id();
electrical_sensor_config.power_topology.delegate = &powerTopologyDelegate;
electrical_sensor_config.electrical_power_measurement.feature_flags =
esp_matter::cluster::electrical_power_measurement::feature::direct_current::get_id() |
esp_matter::cluster::electrical_power_measurement::feature::alternating_current::get_id();
electrical_sensor_config.electrical_power_measurement.delegate = &electricalPowerMeasurementDelegate;
endpoint = esp_matter::endpoint::electrical_sensor::create(node, &electrical_sensor_config, ENDPOINT_FLAG_NONE, NULL);
if (endpoint) {
@@ -505,9 +533,13 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_ENERGY_EVSE: {
esp_matter::endpoint::energy_evse::config_t energy_evse_config;
static chip::app::Clusters::EnergyEvse::MockEnergyEVSEDelegate energyEvseDelegate;
static chip::app::Clusters::ModeBase::MockModeBaseDelegate evseModeDelegate;
static chip::app::Clusters::DeviceEnergyManagement::MockDeviceEnergyManagementDelegate evseDemDelegate;
energy_evse_config.energy_evse.delegate = &energyEvseDelegate;
energy_evse_config.energy_evse_mode.delegate = &evseModeDelegate;
energy_evse_config.device_energy_management.delegate = &evseDemDelegate;
endpoint = esp_matter::endpoint::energy_evse::create(node, &energy_evse_config, ENDPOINT_FLAG_NONE, NULL);
cluster_t *energy_evse_cluster = cluster::get(endpoint, chip::app::Clusters::EnergyEvse::Id);
cluster::energy_evse::feature::charging_preferences::add(energy_evse_cluster);
esp_matter::endpoint::power_source::config_t power_source_config;
esp_matter::endpoint_t *ps_endpoint = esp_matter::endpoint::power_source::create(node, &power_source_config, ENDPOINT_FLAG_NONE, NULL);
@@ -522,28 +554,42 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_MICROWAVE_OVEN: {
esp_matter::endpoint::microwave_oven::config_t microwave_oven_config;
microwave_oven_config.microwave_oven_control.feature_flags = esp_matter::cluster::microwave_oven_control::feature::power_as_number::get_id();
static chip::app::Clusters::MicrowaveOvenControl::MockMicrowaveOvenControlDelegate microwaveOvenControlDelegate;
static chip::app::Clusters::OperationalState::MockOperationalStateDelegate operationalStateDelegate;
static chip::app::Clusters::ModeBase::MockModeBaseDelegate microwaveOvenModeDelegate;
microwave_oven_config.microwave_oven_control.delegate = &microwaveOvenControlDelegate;
microwave_oven_config.operational_state.delegate = &operationalStateDelegate;
microwave_oven_config.microwave_oven_mode.delegate = &microwaveOvenModeDelegate;
endpoint = esp_matter::endpoint::microwave_oven::create(node, &microwave_oven_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
case ESP_MATTER_EXTRACTOR_HOOD: {
esp_matter::endpoint::extractor_hood::config_t extractor_hood_config;
static chip::app::Clusters::FanControl::MockFanControlDelegate extractorHoodFanDelegate;
extractor_hood_config.fan_control.delegate = &extractorHoodFanDelegate;
endpoint = esp_matter::endpoint::extractor_hood::create(node, &extractor_hood_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
case ESP_MATTER_LAUNDRY_DRYER: {
esp_matter::endpoint::laundry_dryer::config_t laundry_dryer_config;
static chip::app::Clusters::OperationalState::MockOperationalStateDelegate laundryDryerOpStateDelegate;
laundry_dryer_config.operational_state.delegate = &laundryDryerOpStateDelegate;
endpoint = esp_matter::endpoint::laundry_dryer::create(node, &laundry_dryer_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
case ESP_MATTER_WATER_VALVE: {
esp_matter::endpoint::water_valve::config_t water_valve_config;
static chip::app::Clusters::ValveConfigurationAndControl::MockValveConfigurationAndControlDelegate valveDelegate;
water_valve_config.valve_configuration_and_control.delegate = &valveDelegate;
endpoint = esp_matter::endpoint::water_valve::create(node, &water_valve_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
case ESP_MATTER_DEVICE_ENERGY_MANAGEMENT: {
esp_matter::endpoint::device_energy_management::config_t device_energy_management_config;
device_energy_management_config.device_energy_management.feature_flags = esp_matter::cluster::device_energy_management::feature::power_forecast_reporting::get_id();
static chip::app::Clusters::ModeBase::MockModeBaseDelegate demModeDelegate;
static chip::app::Clusters::DeviceEnergyManagement::MockDeviceEnergyManagementDelegate demDelegate;
device_energy_management_config.device_energy_management_mode.delegate = &demModeDelegate;
device_energy_management_config.device_energy_management.delegate = &demDelegate;
endpoint = esp_matter::endpoint::device_energy_management::create(node, &device_energy_management_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
@@ -582,7 +628,13 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_WATER_HEATER: {
esp_matter::endpoint::water_heater::config_t water_heater_config;
static chip::app::Clusters::WaterHeaterManagement::MockWaterHeaterManagementDelegate waterHeaterManagementDelegate;
static chip::app::Clusters::Thermostat::MockThermostatDelegate waterHeaterThermostatDelegate;
static chip::app::Clusters::ModeBase::MockModeBaseDelegate waterHeaterModeDelegate;
water_heater_config.thermostat.feature_flags = cluster::thermostat::feature::heating::get_id();
water_heater_config.thermostat.delegate = &waterHeaterThermostatDelegate;
water_heater_config.water_heater_management.delegate = &waterHeaterManagementDelegate;
water_heater_config.water_heater_mode.delegate = &waterHeaterModeDelegate;
endpoint = esp_matter::endpoint::water_heater::create(node, &water_heater_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
@@ -603,6 +655,7 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_CHIME: {
esp_matter::endpoint::chime::config_t chime_config;
static chip::app::Clusters::Chime::MockChimeDelegate chimeDelegate;
chime_config.chime.delegate = &chimeDelegate;
endpoint = esp_matter::endpoint::chime::create(node, &chime_config, ENDPOINT_FLAG_NONE, NULL);
break;
@@ -619,13 +672,17 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_CLOSURE: {
esp_matter::endpoint::closure::config_t closure_config;
static chip::app::Clusters::ClosureControl::MockClosureControlDelegate closureControlDelegate;
closure_config.closure_control.delegate = &closureControlDelegate;
closure_config.closure_control.feature_flags = cluster::closure_control::feature::positioning::get_id();
endpoint = esp_matter::endpoint::closure::create(node, &closure_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
case ESP_MATTER_CLOSURE_PANEL: {
esp_matter::endpoint::closure_panel::config_t closure_panel_config;
closure_panel_config.closure_dimension.feature_flags = cluster::closure_dimension::feature::positioning::get_id() | cluster::closure_dimension::feature::rotation::get_id();
static chip::app::Clusters::ClosureDimension::MockClosureDimensionDelegate closureDimensionDelegate;
closure_panel_config.closure_dimension.delegate = &closureDimensionDelegate;
closure_panel_config.closure_dimension.feature_flags = cluster::closure_dimension::feature::positioning::get_id();
endpoint = esp_matter::endpoint::closure_panel::create(node, &closure_panel_config, ENDPOINT_FLAG_NONE, NULL);
break;
}
@@ -633,10 +690,14 @@ int create(uint8_t device_type_index)
esp_matter::endpoint::electrical_energy_tariff::config_t electrical_energy_tariff_config;
endpoint = esp_matter::endpoint::electrical_energy_tariff::create(node, &electrical_energy_tariff_config, ENDPOINT_FLAG_NONE, NULL);
static chip::app::Clusters::CommodityPrice::MockCommodityPriceDelegate commodityPriceDelegate;
cluster::commodity_price::config_t commodity_price_config;
commodity_price_config.delegate = &commodityPriceDelegate;
cluster::commodity_price::create(endpoint, &commodity_price_config, CLUSTER_FLAG_SERVER);
static chip::app::Clusters::CommodityTariff::MockCommodityTariffDelegate commodityTariffDelegate;
cluster::commodity_tariff::config_t commodity_tariff_config;
commodity_tariff_config.delegate = &commodityTariffDelegate;
commodity_tariff_config.feature_flags = cluster::commodity_tariff::feature::pricing::get_id();
cluster::commodity_tariff::create(endpoint, &commodity_tariff_config, CLUSTER_FLAG_SERVER);
@@ -644,7 +705,9 @@ int create(uint8_t device_type_index)
}
case ESP_MATTER_ELECTRICAL_METER: {
esp_matter::endpoint::electrical_meter::config_t electrical_meter_config;
static chip::app::Clusters::ElectricalPowerMeasurement::MockElectricalPowerMeasurementDelegate electricalMeterPowerDelegate;
electrical_meter_config.electrical_power_measurement.feature_flags = cluster::electrical_power_measurement::feature::direct_current::get_id();
electrical_meter_config.electrical_power_measurement.delegate = &electricalMeterPowerDelegate;
electrical_meter_config.electrical_energy_measurement.feature_flags = cluster::electrical_energy_measurement::feature::imported_energy::get_id() |
cluster::electrical_energy_measurement::feature::exported_energy::get_id() |
cluster::electrical_energy_measurement::feature::cumulative_energy::get_id() |
@@ -19,6 +19,7 @@ void MockAccountLoginDelegate::SetSetupPin(char * setupPin)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
bool MockAccountLoginDelegate::HandleLogin(const chip::CharSpan &tempAccountIdentifierString, const chip::CharSpan &setupPinString,
@@ -41,12 +42,14 @@ void MockAccountLoginDelegate::HandleGetSetupPin(CommandResponseHelper<Commands:
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockAccountLoginDelegate::GetSetupPin(char * setupPin, size_t setupPinSize, const chip::CharSpan &tempAccountIdentifierString)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
uint16_t MockAccountLoginDelegate::GetClusterRevision(chip::EndpointId endpoint)
@@ -8,8 +8,6 @@
#pragma once
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/account-login-server/account-login-delegate.h>
/*
@@ -17,9 +15,9 @@
* This file provides a mock implementation of the AccountLogin::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/master/src/app/clusters/account-login-server/account-login-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/master/examples/tv-app/android/include/account-login/AccountLoginManager.h and
* https://github.com/project-chip/connectedhomeip/blob/master/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/account-login-server/account-login-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/android/include/account-login/AccountLoginManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
*/
namespace chip {
@@ -0,0 +1,131 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_actions_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace Actions {
CHIP_ERROR MockActionsDelegate::ReadActionAtIndex(uint16_t index, ActionStructStorage &action)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockActionsDelegate::ReadEndpointListAtIndex(uint16_t index, EndpointListStorage &epList)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
bool MockActionsDelegate::HaveActionWithId(uint16_t aActionId, uint16_t &aActionIndex)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return false;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleInstantAction(uint16_t actionId, Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleInstantActionWithTransition(uint16_t actionId, uint16_t transitionTime,
Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleStartAction(uint16_t actionId, Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleStartActionWithDuration(uint16_t actionId, uint32_t duration,
Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleStopAction(uint16_t actionId, Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandlePauseAction(uint16_t actionId, Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandlePauseActionWithDuration(uint16_t actionId, uint32_t duration,
Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleResumeAction(uint16_t actionId, Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleEnableAction(uint16_t actionId, Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleEnableActionWithDuration(uint16_t actionId, uint32_t duration,
Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleDisableAction(uint16_t actionId, Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockActionsDelegate::HandleDisableActionWithDuration(uint16_t actionId, uint32_t duration,
Optional<uint32_t> invokeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
} // namespace Actions
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,65 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/actions-server/actions-server.h>
#include <protocols/interaction_model/StatusCode.h>
/*
* Mock Actions Delegate Implementation
* This file provides a mock implementation of the Actions::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/actions-server/actions-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/bridged-actions-stub.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace Actions {
class MockActionsDelegate : public Delegate {
public:
MockActionsDelegate() = default;
virtual ~MockActionsDelegate() = default;
// Action list management
CHIP_ERROR ReadActionAtIndex(uint16_t index, ActionStructStorage &action) override;
CHIP_ERROR ReadEndpointListAtIndex(uint16_t index, EndpointListStorage &epList) override;
bool HaveActionWithId(uint16_t aActionId, uint16_t &aActionIndex) override;
// Action command handlers
Protocols::InteractionModel::Status HandleInstantAction(uint16_t actionId, Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleInstantActionWithTransition(uint16_t actionId, uint16_t transitionTime,
Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleStartAction(uint16_t actionId, Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleStartActionWithDuration(uint16_t actionId, uint32_t duration,
Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleStopAction(uint16_t actionId, Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandlePauseAction(uint16_t actionId, Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandlePauseActionWithDuration(uint16_t actionId, uint32_t duration,
Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleResumeAction(uint16_t actionId, Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleEnableAction(uint16_t actionId, Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleEnableActionWithDuration(uint16_t actionId, uint32_t duration,
Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleDisableAction(uint16_t actionId, Optional<uint32_t> invokeId) override;
Protocols::InteractionModel::Status HandleDisableActionWithDuration(uint16_t actionId, uint32_t duration,
Optional<uint32_t> invokeId) override;
private:
static constexpr const char * LOG_TAG = "MockActionsDelegate";
};
} // namespace Actions
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,70 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_application_basic_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ApplicationBasic {
CHIP_ERROR MockApplicationBasicDelegate::HandleGetVendorName(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
uint16_t MockApplicationBasicDelegate::HandleGetVendorId()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockApplicationBasicDelegate::HandleGetApplicationName(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
uint16_t MockApplicationBasicDelegate::HandleGetProductId()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockApplicationBasicDelegate::HandleGetApplicationVersion(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
CHIP_ERROR MockApplicationBasicDelegate::HandleGetAllowedVendorList(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
std::list<uint16_t> MockApplicationBasicDelegate::GetAllowedVendorList()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return std::list<uint16_t>();
}
} // namespace ApplicationBasic
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,51 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/application-basic-server/application-basic-delegate.h>
/*
* Mock ApplicationBasic Delegate Implementation
* This file provides a mock implementation of the ApplicationBasic::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/application-basic-server/application-basic-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/application-basic/ApplicationBasicManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/application-basic/ApplicationBasicManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ApplicationBasic {
class MockApplicationBasicDelegate : public Delegate {
public:
MockApplicationBasicDelegate() : Delegate() {}
MockApplicationBasicDelegate(uint16_t szCatalogVendorId, const char * szApplicationId)
: Delegate(szCatalogVendorId, szApplicationId) {}
virtual ~MockApplicationBasicDelegate() = default;
// Application basic attribute handlers
CHIP_ERROR HandleGetVendorName(app::AttributeValueEncoder &aEncoder) override;
uint16_t HandleGetVendorId() override;
CHIP_ERROR HandleGetApplicationName(app::AttributeValueEncoder &aEncoder) override;
uint16_t HandleGetProductId() override;
CHIP_ERROR HandleGetApplicationVersion(app::AttributeValueEncoder &aEncoder) override;
CHIP_ERROR HandleGetAllowedVendorList(app::AttributeValueEncoder &aEncoder) override;
std::list<uint16_t> GetAllowedVendorList() override;
private:
static constexpr const char * LOG_TAG = "MockApplicationBasicDelegate";
};
} // namespace ApplicationBasic
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,56 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_application_launcher_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ApplicationLauncher {
CHIP_ERROR MockApplicationLauncherDelegate::HandleGetCatalogList(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
void MockApplicationLauncherDelegate::HandleLaunchApp(CommandResponseHelper<LauncherResponseType> &helper, const ByteSpan &data,
const Application &application)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
LauncherResponseType response;
response.status = ApplicationLauncherStatusEnum::kSuccess;
helper.Success(response);
}
void MockApplicationLauncherDelegate::HandleStopApp(CommandResponseHelper<LauncherResponseType> &helper, const Application &application)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
LauncherResponseType response;
response.status = ApplicationLauncherStatusEnum::kSuccess;
helper.Success(response);
}
void MockApplicationLauncherDelegate::HandleHideApp(CommandResponseHelper<LauncherResponseType> &helper, const Application &application)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
LauncherResponseType response;
response.status = ApplicationLauncherStatusEnum::kSuccess;
helper.Success(response);
}
} // namespace ApplicationLauncher
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,48 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/application-launcher-server/application-launcher-delegate.h>
/*
* Mock ApplicationLauncher Delegate Implementation
* This file provides a mock implementation of the ApplicationLauncher::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/application-launcher-server/application-launcher-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/application-launcher/ApplicationLauncherManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/application-launcher/ApplicationLauncherManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ApplicationLauncher {
class MockApplicationLauncherDelegate : public Delegate {
public:
MockApplicationLauncherDelegate() = default;
MockApplicationLauncherDelegate(bool featureMapContentPlatform) : Delegate(featureMapContentPlatform) {}
CHIP_ERROR HandleGetCatalogList(app::AttributeValueEncoder &aEncoder) override;
void HandleLaunchApp(CommandResponseHelper<LauncherResponseType> &helper, const ByteSpan &data,
const Application &application) override;
void HandleStopApp(CommandResponseHelper<LauncherResponseType> &helper, const Application &application) override;
void HandleHideApp(CommandResponseHelper<LauncherResponseType> &helper, const Application &application) override;
private:
const char *LOG_TAG = "application_launcher";
};
} // namespace ApplicationLauncher
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,49 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_audio_output_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace AudioOutput {
uint8_t MockAudioOutputDelegate::HandleGetCurrentOutput()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockAudioOutputDelegate::HandleGetOutputList(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
bool MockAudioOutputDelegate::HandleRenameOutput(const uint8_t &index, const chip::CharSpan &name)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockAudioOutputDelegate::HandleSelectOutput(const uint8_t &index)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
} // namespace AudioOutput
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,46 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/audio-output-server/audio-output-delegate.h>
/*
* Mock AudioOutput Delegate Implementation
* This file provides a mock implementation of the AudioOutput::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/audio-output-server/audio-output-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/audio-output/AudioOutputManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/audio-output/AudioOutputManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace AudioOutput {
class MockAudioOutputDelegate : public Delegate {
public:
MockAudioOutputDelegate() = default;
uint8_t HandleGetCurrentOutput() override;
CHIP_ERROR HandleGetOutputList(app::AttributeValueEncoder &aEncoder) override;
bool HandleRenameOutput(const uint8_t &index, const chip::CharSpan &name) override;
bool HandleSelectOutput(const uint8_t &index) override;
private:
const char *LOG_TAG = "audio_output";
};
} // namespace AudioOutput
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,35 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_boolean_state_configuration_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace BooleanStateConfiguration {
CHIP_ERROR MockBooleanStateConfigurationDelegate::HandleSuppressAlarm(BooleanStateConfiguration::AlarmModeBitmap alarmToSuppress)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockBooleanStateConfigurationDelegate::HandleEnableDisableAlarms(chip::BitMask<BooleanStateConfiguration::AlarmModeBitmap> alarms)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace BooleanStateConfiguration
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,43 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/boolean-state-configuration-server/boolean-state-configuration-delegate.h>
/*
* Mock BooleanStateConfiguration Delegate Implementation
* This file provides a mock implementation of the BooleanStateConfiguration::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/boolcfg-stub.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace BooleanStateConfiguration {
class MockBooleanStateConfigurationDelegate : public Delegate {
public:
MockBooleanStateConfigurationDelegate() : Delegate() {}
virtual ~MockBooleanStateConfigurationDelegate() = default;
// Boolean state configuration command handlers
CHIP_ERROR HandleSuppressAlarm(BooleanStateConfiguration::AlarmModeBitmap alarmToSuppress) override;
CHIP_ERROR HandleEnableDisableAlarms(chip::BitMask<BooleanStateConfiguration::AlarmModeBitmap> alarms) override;
private:
static constexpr const char * LOG_TAG = "MockBooleanStateConfigurationDelegate";
};
} // namespace BooleanStateConfiguration
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,143 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_camera_av_settings_user_level_management_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace CameraAvSettingsUserLevelManagement {
void MockCameraAVSettingsUserLevelManagementDelegate::ShutdownApp()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
bool MockCameraAVSettingsUserLevelManagementDelegate::CanChangeMPTZ()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
void MockCameraAVSettingsUserLevelManagementDelegate::VideoStreamAllocated(uint16_t aStreamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockCameraAVSettingsUserLevelManagementDelegate::VideoStreamDeallocated(uint16_t aStreamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockCameraAVSettingsUserLevelManagementDelegate::DefaultViewportUpdated(Globals::Structs::ViewportStruct::Type aViewport)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
Protocols::InteractionModel::Status MockCameraAVSettingsUserLevelManagementDelegate::MPTZSetPosition(Optional<int16_t> aPan, Optional<int16_t> aTilt,
Optional<uint8_t> aZoom, PhysicalPTZCallback * callback)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
if (callback) {
callback->OnPhysicalMovementComplete(Protocols::InteractionModel::Status::Success);
}
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVSettingsUserLevelManagementDelegate::MPTZRelativeMove(Optional<int16_t> aPan, Optional<int16_t> aTilt,
Optional<uint8_t> aZoom, PhysicalPTZCallback * callback)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
if (callback) {
callback->OnPhysicalMovementComplete(Protocols::InteractionModel::Status::Success);
}
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVSettingsUserLevelManagementDelegate::MPTZMoveToPreset(uint8_t aPreset, Optional<int16_t> aPan, Optional<int16_t> aTilt,
Optional<uint8_t> aZoom, PhysicalPTZCallback * callback)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
if (callback) {
callback->OnPhysicalMovementComplete(Protocols::InteractionModel::Status::Success);
}
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVSettingsUserLevelManagementDelegate::MPTZSavePreset(uint8_t aPreset)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVSettingsUserLevelManagementDelegate::MPTZRemovePreset(uint8_t aPreset)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVSettingsUserLevelManagementDelegate::DPTZSetViewport(uint16_t aVideoStreamID,
Globals::Structs::ViewportStruct::Type aViewport)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVSettingsUserLevelManagementDelegate::DPTZRelativeMove(uint16_t aVideoStreamID, Optional<int16_t> aDeltaX,
Optional<int16_t> aDeltaY, Optional<int8_t> aZoomDelta,
Globals::Structs::ViewportStruct::Type &aViewport)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR MockCameraAVSettingsUserLevelManagementDelegate::PersistentAttributesLoadedCallback()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockCameraAVSettingsUserLevelManagementDelegate::LoadMPTZPresets(std::vector<MPTZPresetHelper> &mptzPresetHelpers)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
mptzPresetHelpers.clear();
return CHIP_NO_ERROR;
}
CHIP_ERROR MockCameraAVSettingsUserLevelManagementDelegate::LoadDPTZStreams(std::vector<DPTZStruct> &dptzStreams)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
dptzStreams.clear();
return CHIP_NO_ERROR;
}
} // namespace CameraAvSettingsUserLevelManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,76 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/camera-av-settings-user-level-management-server/CameraAvSettingsUserLevelManagementCluster.h>
#include <protocols/interaction_model/StatusCode.h>
/*
* Mock CameraAVSettingsUserLevelManagement Delegate Implementation
* This file provides a mock implementation of the CameraAVSettingsUserLevelManagement::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/camera-av-settings-user-level-management-server/camera-av-settings-user-level-management-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/camera-av-settings-user-level-management-instance.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/camera-av-settings-user-level-management-stub.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace CameraAvSettingsUserLevelManagement {
class MockCameraAVSettingsUserLevelManagementDelegate : public CameraAvSettingsUserLevelManagementDelegate {
public:
MockCameraAVSettingsUserLevelManagementDelegate() : CameraAvSettingsUserLevelManagementDelegate() {}
virtual ~MockCameraAVSettingsUserLevelManagementDelegate() = default;
// Shutdown handler
void ShutdownApp() override;
// Camera AV settings management
bool CanChangeMPTZ() override;
// DPTZ stream handling
void VideoStreamAllocated(uint16_t aStreamID) override;
void VideoStreamDeallocated(uint16_t aStreamID) override;
void DefaultViewportUpdated(Globals::Structs::ViewportStruct::Type aViewport) override;
// MPTZ command handlers
Protocols::InteractionModel::Status MPTZSetPosition(Optional<int16_t> aPan, Optional<int16_t> aTilt,
Optional<uint8_t> aZoom, PhysicalPTZCallback * callback) override;
Protocols::InteractionModel::Status MPTZRelativeMove(Optional<int16_t> aPan, Optional<int16_t> aTilt,
Optional<uint8_t> aZoom, PhysicalPTZCallback * callback) override;
Protocols::InteractionModel::Status MPTZMoveToPreset(uint8_t aPreset, Optional<int16_t> aPan, Optional<int16_t> aTilt,
Optional<uint8_t> aZoom, PhysicalPTZCallback * callback) override;
Protocols::InteractionModel::Status MPTZSavePreset(uint8_t aPreset) override;
Protocols::InteractionModel::Status MPTZRemovePreset(uint8_t aPreset) override;
// DPTZ command handlers
Protocols::InteractionModel::Status DPTZSetViewport(uint16_t aVideoStreamID,
Globals::Structs::ViewportStruct::Type aViewport) override;
Protocols::InteractionModel::Status DPTZRelativeMove(uint16_t aVideoStreamID, Optional<int16_t> aDeltaX,
Optional<int16_t> aDeltaY, Optional<int8_t> aZoomDelta,
Globals::Structs::ViewportStruct::Type &aViewport) override;
// Persistent attributes callback
CHIP_ERROR PersistentAttributesLoadedCallback() override;
// Load handlers
CHIP_ERROR LoadMPTZPresets(std::vector<MPTZPresetHelper> &mptzPresetHelpers) override;
CHIP_ERROR LoadDPTZStreams(std::vector<DPTZStruct> &dptzStreams) override;
private:
static constexpr const char * LOG_TAG = "MockCameraAVSettingsUserLevelMgmtDelegate";
};
} // namespace CameraAvSettingsUserLevelManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,146 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_camera_av_stream_management_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace CameraAvStreamManagement {
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::VideoStreamAllocate(const VideoStreamStruct &allocateArgs,
uint16_t &outStreamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
outStreamID = 0;
return Protocols::InteractionModel::Status::Success;
}
void MockCameraAVStreamManagementDelegate::OnVideoStreamAllocated(const VideoStreamStruct &allocatedStream, StreamAllocationAction action)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::VideoStreamModify(const uint16_t streamID, const Optional<bool> waterMarkEnabled,
const Optional<bool> osdEnabled)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::VideoStreamDeallocate(const uint16_t streamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::AudioStreamAllocate(const AudioStreamStruct &allocateArgs,
uint16_t &outStreamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
outStreamID = 0;
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::AudioStreamDeallocate(const uint16_t streamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::SnapshotStreamAllocate(const SnapshotStreamAllocateArgs &allocateArgs,
uint16_t &outStreamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
outStreamID = 0;
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::SnapshotStreamModify(const uint16_t streamID, const Optional<bool> waterMarkEnabled,
const Optional<bool> osdEnabled)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::SnapshotStreamDeallocate(const uint16_t streamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
void MockCameraAVStreamManagementDelegate::OnStreamUsagePrioritiesChanged()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockCameraAVStreamManagementDelegate::OnAttributeChanged(AttributeId attributeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
Protocols::InteractionModel::Status MockCameraAVStreamManagementDelegate::CaptureSnapshot(const DataModel::Nullable<uint16_t> streamID,
const VideoResolutionStruct &resolution,
ImageSnapshot &outImageSnapshot)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR MockCameraAVStreamManagementDelegate::PersistentAttributesLoadedCallback()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockCameraAVStreamManagementDelegate::OnTransportAcquireAudioVideoStreams(uint16_t audioStreamID, uint16_t videoStreamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockCameraAVStreamManagementDelegate::OnTransportReleaseAudioVideoStreams(uint16_t audioStreamID, uint16_t videoStreamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
const std::vector<VideoStreamStruct> &MockCameraAVStreamManagementDelegate::GetAllocatedVideoStreams() const
{
return mAllocatedVideoStreams;
}
const std::vector<AudioStreamStruct> &MockCameraAVStreamManagementDelegate::GetAllocatedAudioStreams() const
{
return mAllocatedAudioStreams;
}
} // namespace CameraAvStreamManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,81 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/camera-av-stream-management-server/CameraAVStreamManagementCluster.h>
#include <protocols/interaction_model/StatusCode.h>
/*
* Mock CameraAVStreamManagement Delegate Implementation
* This file provides a mock implementation of the CameraAVStreamMgmtDelegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h
*/
namespace chip {
namespace app {
namespace Clusters {
namespace CameraAvStreamManagement {
class MockCameraAVStreamManagementDelegate : public CameraAVStreamManagementDelegate {
public:
MockCameraAVStreamManagementDelegate() = default;
virtual ~MockCameraAVStreamManagementDelegate() = default;
// Video stream handlers
Protocols::InteractionModel::Status VideoStreamAllocate(const VideoStreamStruct &allocateArgs,
uint16_t &outStreamID) override;
void OnVideoStreamAllocated(const VideoStreamStruct &allocatedStream, StreamAllocationAction action) override;
Protocols::InteractionModel::Status VideoStreamModify(const uint16_t streamID, const Optional<bool> waterMarkEnabled,
const Optional<bool> osdEnabled) override;
Protocols::InteractionModel::Status VideoStreamDeallocate(const uint16_t streamID) override;
// Audio stream handlers
Protocols::InteractionModel::Status AudioStreamAllocate(const AudioStreamStruct &allocateArgs,
uint16_t &outStreamID) override;
Protocols::InteractionModel::Status AudioStreamDeallocate(const uint16_t streamID) override;
// Snapshot stream handlers
Protocols::InteractionModel::Status SnapshotStreamAllocate(const SnapshotStreamAllocateArgs &allocateArgs,
uint16_t &outStreamID) override;
Protocols::InteractionModel::Status SnapshotStreamModify(const uint16_t streamID, const Optional<bool> waterMarkEnabled,
const Optional<bool> osdEnabled) override;
Protocols::InteractionModel::Status SnapshotStreamDeallocate(const uint16_t streamID) override;
// Callback handlers
void OnStreamUsagePrioritiesChanged() override;
void OnAttributeChanged(AttributeId attributeId) override;
// Capture snapshot
Protocols::InteractionModel::Status CaptureSnapshot(const DataModel::Nullable<uint16_t> streamID,
const VideoResolutionStruct &resolution,
ImageSnapshot &outImageSnapshot) override;
// Persistent attributes callback
CHIP_ERROR PersistentAttributesLoadedCallback() override;
// Transport stream handlers
CHIP_ERROR OnTransportAcquireAudioVideoStreams(uint16_t audioStreamID, uint16_t videoStreamID) override;
CHIP_ERROR OnTransportReleaseAudioVideoStreams(uint16_t audioStreamID, uint16_t videoStreamID) override;
// Stream accessors
const std::vector<VideoStreamStruct> &GetAllocatedVideoStreams() const override;
const std::vector<AudioStreamStruct> &GetAllocatedAudioStreams() const override;
private:
static constexpr const char * LOG_TAG = "MockCameraAVStreamMgmtDelegate";
std::vector<VideoStreamStruct> mAllocatedVideoStreams;
std::vector<AudioStreamStruct> mAllocatedAudioStreams;
};
} // namespace CameraAvStreamManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,112 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_channel_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace Channel {
CHIP_ERROR MockChannelDelegate::HandleGetChannelList(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
CHIP_ERROR MockChannelDelegate::HandleGetLineup(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
CHIP_ERROR MockChannelDelegate::HandleGetCurrentChannel(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
void MockChannelDelegate::HandleChangeChannel(CommandResponseHelper<Commands::ChangeChannelResponse::Type> &helper,
const chip::CharSpan &match)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::ChangeChannelResponse::Type response;
response.status = ChannelStatusEnum::kSuccess;
helper.Success(response);
}
bool MockChannelDelegate::HandleChangeChannelByNumber(const uint16_t &majorNumber, const uint16_t &minorNumber)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockChannelDelegate::HandleSkipChannel(const int16_t &count)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
void MockChannelDelegate::HandleGetProgramGuide(CommandResponseHelper<Commands::ProgramGuideResponse::Type> &helper,
const chip::Optional<uint32_t> &startTime, const chip::Optional<uint32_t> &endTime,
const chip::Optional<DataModel::DecodableList<ChannelInfo>> &channelList,
const chip::Optional<PageToken> &pageToken,
const chip::Optional<chip::BitMask<RecordingFlagBitmap>> &recordingFlag,
const chip::Optional<DataModel::DecodableList<AdditionalInfo>> &externalIdList,
const chip::Optional<chip::ByteSpan> &data)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::ProgramGuideResponse::Type response;
helper.Success(response);
}
bool MockChannelDelegate::HandleRecordProgram(const chip::CharSpan &programIdentifier, bool shouldRecordSeries,
const DataModel::DecodableList<AdditionalInfo> &externalIdList,
const chip::ByteSpan &data)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockChannelDelegate::HandleCancelRecordProgram(const chip::CharSpan &programIdentifier, bool shouldRecordSeries,
const DataModel::DecodableList<AdditionalInfo> &externalIdList,
const chip::ByteSpan &data)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
uint32_t MockChannelDelegate::GetFeatureMap(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint16_t MockChannelDelegate::GetClusterRevision(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
} // namespace Channel
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,68 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/channel-server/channel-delegate.h>
/*
* Mock Channel Delegate Implementation
* This file provides a mock implementation of the Channel::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/channel-server/channel-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/channel/ChannelManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace Channel {
class MockChannelDelegate : public Delegate {
public:
MockChannelDelegate() = default;
CHIP_ERROR HandleGetChannelList(app::AttributeValueEncoder &aEncoder) override;
CHIP_ERROR HandleGetLineup(app::AttributeValueEncoder &aEncoder) override;
CHIP_ERROR HandleGetCurrentChannel(app::AttributeValueEncoder &aEncoder) override;
void HandleChangeChannel(CommandResponseHelper<Commands::ChangeChannelResponse::Type> &helper,
const chip::CharSpan &match) override;
bool HandleChangeChannelByNumber(const uint16_t &majorNumber, const uint16_t &minorNumber) override;
bool HandleSkipChannel(const int16_t &count) override;
void HandleGetProgramGuide(CommandResponseHelper<Commands::ProgramGuideResponse::Type> &helper,
const chip::Optional<uint32_t> &startTime, const chip::Optional<uint32_t> &endTime,
const chip::Optional<DataModel::DecodableList<ChannelInfo>> &channelList,
const chip::Optional<PageToken> &pageToken,
const chip::Optional<chip::BitMask<RecordingFlagBitmap>> &recordingFlag,
const chip::Optional<DataModel::DecodableList<AdditionalInfo>> &externalIdList,
const chip::Optional<chip::ByteSpan> &data) override;
bool HandleRecordProgram(const chip::CharSpan &programIdentifier, bool shouldRecordSeries,
const DataModel::DecodableList<AdditionalInfo> &externalIdList,
const chip::ByteSpan &data) override;
bool HandleCancelRecordProgram(const chip::CharSpan &programIdentifier, bool shouldRecordSeries,
const DataModel::DecodableList<AdditionalInfo> &externalIdList,
const chip::ByteSpan &data) override;
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
uint16_t GetClusterRevision(chip::EndpointId endpoint) override;
private:
const char *LOG_TAG = "channel";
};
} // namespace Channel
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,68 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_closure_control_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ClosureControl {
Protocols::InteractionModel::Status MockClosureControlDelegate::HandleStopCommand()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockClosureControlDelegate::HandleMoveToCommand(const Optional<TargetPositionEnum> &position,
const Optional<bool> &latch,
const Optional<Globals::ThreeLevelAutoEnum> &speed)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockClosureControlDelegate::HandleCalibrateCommand()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
bool MockClosureControlDelegate::IsReadyToMove()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
ElapsedS MockClosureControlDelegate::GetCalibrationCountdownTime()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return ElapsedS(0);
}
ElapsedS MockClosureControlDelegate::GetMovingCountdownTime()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return ElapsedS(0);
}
ElapsedS MockClosureControlDelegate::GetWaitingForMotionCountdownTime()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return ElapsedS(0);
}
} // namespace ClosureControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,54 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/closure-control-server/closure-control-cluster-delegate.h>
#include <protocols/interaction_model/StatusCode.h>
/*
* Mock ClosureControl Delegate Implementation
* This file provides a mock implementation of the ClosureControl::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/closure-control-server/closure-control-cluster-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/closure-app/closure-common/include/ClosureControlEndpoint.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/closure-app/closure-common/src/ClosureControlEndpoint.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ClosureControl {
class MockClosureControlDelegate : public DelegateBase {
public:
MockClosureControlDelegate() : DelegateBase() {}
virtual ~MockClosureControlDelegate() = default;
// Closure control command handlers
Protocols::InteractionModel::Status HandleStopCommand() override;
Protocols::InteractionModel::Status HandleMoveToCommand(const Optional<TargetPositionEnum> &position,
const Optional<bool> &latch,
const Optional<Globals::ThreeLevelAutoEnum> &speed) override;
Protocols::InteractionModel::Status HandleCalibrateCommand() override;
// Attribute getters
bool IsReadyToMove() override;
ElapsedS GetCalibrationCountdownTime() override;
ElapsedS GetMovingCountdownTime() override;
ElapsedS GetWaitingForMotionCountdownTime() override;
private:
static constexpr const char * LOG_TAG = "MockClosureControlDelegate";
};
} // namespace ClosureControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,39 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_closure_dimension_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ClosureDimension {
Protocols::InteractionModel::Status MockClosureDimensionDelegate::HandleSetTarget(const Optional<Percent100ths> &position,
const Optional<bool> &latch,
const Optional<Globals::ThreeLevelAutoEnum> &speed)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockClosureDimensionDelegate::HandleStep(const StepDirectionEnum &direction,
const uint16_t &numberOfSteps,
const Optional<Globals::ThreeLevelAutoEnum> &speed)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
} // namespace ClosureDimension
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,48 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <protocols/interaction_model/StatusCode.h>
#include <app/clusters/closure-dimension-server/closure-dimension-delegate.h>
/*
* Mock ClosureDimension Delegate Implementation
* This file provides a mock implementation of the ClosureDimension::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/closure-dimension-server/closure-dimension-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/closure-app/closure-common/include/ClosureDimensionEndpoint.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/closure-app/closure-common/src/ClosureDimensionEndpoint.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ClosureDimension {
class MockClosureDimensionDelegate : public DelegateBase {
public:
MockClosureDimensionDelegate() : DelegateBase() {}
virtual ~MockClosureDimensionDelegate() = default;
// Closure dimension command handlers
Protocols::InteractionModel::Status HandleSetTarget(const Optional<Percent100ths> &position,
const Optional<bool> &latch,
const Optional<Globals::ThreeLevelAutoEnum> &speed) override;
Protocols::InteractionModel::Status HandleStep(const StepDirectionEnum &direction, const uint16_t &numberOfSteps,
const Optional<Globals::ThreeLevelAutoEnum> &speed) override;
private:
static constexpr const char * LOG_TAG = "MockClosureDimensionDelegate";
};
} // namespace ClosureDimension
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,49 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_commissioner_control_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace CommissionerControl {
CHIP_ERROR MockCommissionerControlDelegate::HandleCommissioningApprovalRequest(const CommissioningApprovalRequest &request)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockCommissionerControlDelegate::ValidateCommissionNodeCommand(NodeId clientNodeId, uint64_t requestId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockCommissionerControlDelegate::GetCommissioningWindowParams(CommissioningWindowParams &outParams)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockCommissionerControlDelegate::HandleCommissionNode(const CommissioningWindowParams &params)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace CommissionerControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,46 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/commissioner-control-server/commissioner-control-server.h>
/*
* Mock CommissionerControl Delegate Implementation
* This file provides a mock implementation of the CommissionerControl::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/commissioner-control-server/commissioner-control-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/fabric-bridge-app/linux/include/CommissionerControlDelegate.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/fabric-bridge-app/linux/CommissionerControlDelegate.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace CommissionerControl {
class MockCommissionerControlDelegate : public Delegate {
public:
MockCommissionerControlDelegate() = default;
virtual ~MockCommissionerControlDelegate() = default;
// Commissioner control management
CHIP_ERROR HandleCommissioningApprovalRequest(const CommissioningApprovalRequest &request) override;
CHIP_ERROR ValidateCommissionNodeCommand(NodeId clientNodeId, uint64_t requestId) override;
CHIP_ERROR GetCommissioningWindowParams(CommissioningWindowParams &outParams) override;
CHIP_ERROR HandleCommissionNode(const CommissioningWindowParams &params) override;
private:
static constexpr const char * LOG_TAG = "MockCommissionerControlDelegate";
};
} // namespace CommissionerControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,25 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_commodity_price_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace CommodityPrice {
// Note: This delegate is mostly a placeholder as mentioned in the original header
// There are no delegated methods since these are largely implemented in the
// commodity-price-server.cpp Instance class
} // namespace CommodityPrice
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,39 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/commodity-price-server/commodity-price-server.h>
/*
* Mock CommodityPrice Delegate Implementation
* This file provides a mock implementation of the CommodityPrice::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/commodity-price-server/commodity-price-server.h
*/
namespace chip {
namespace app {
namespace Clusters {
namespace CommodityPrice {
class MockCommodityPriceDelegate : public Delegate {
public:
MockCommodityPriceDelegate() = default;
virtual ~MockCommodityPriceDelegate() = default;
// Note: This delegate is mostly a placeholder as mentioned in the original header
// There are no delegated methods since these are largely implemented in the
// commodity-price-server.cpp Instance class
};
} // namespace CommodityPrice
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,41 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/commodity-tariff-server/commodity-tariff-server.h>
/*
* Mock CommodityTariff Delegate Implementation
* This file provides a mock implementation of the CommodityTariff::Delegate interface.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/commodity-tariff-server/commodity-tariff-server.h
*/
namespace chip {
namespace app {
namespace Clusters {
namespace CommodityTariff {
class MockCommodityTariffDelegate : public Delegate {
public:
MockCommodityTariffDelegate() = default;
virtual ~MockCommodityTariffDelegate() = default;
// Note: This delegate is mostly a placeholder.
// The Delegate class has no pure virtual methods - all functionality is
// implemented in the base class with attribute accessors and setters.
private:
static constexpr const char * LOG_TAG = "MockCommodityTariffDelegate";
};
} // namespace CommodityTariff
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,32 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_content_app_observer_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ContentAppObserver {
void MockContentAppObserverDelegate::HandleContentAppMessage(CommandResponseHelper<Commands::ContentAppMessageResponse::Type> &helper,
const chip::Optional<chip::CharSpan> &data, const chip::CharSpan &encodingHint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::ContentAppMessageResponse::Type response;
helper.Success(response);
return;
}
} // namespace ContentAppObserver
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,42 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/content-app-observer/content-app-observer-delegate.h>
/*
* Mock ContentAppObserver Delegate Implementation
* This file provides a mock implementation of the ContentAppObserver::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/content-app-observer/content-app-observer-delegate.h
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ContentAppObserver {
class MockContentAppObserverDelegate : public Delegate {
public:
MockContentAppObserverDelegate() = default;
virtual ~MockContentAppObserverDelegate() = default;
// Content app observer command handlers
void HandleContentAppMessage(CommandResponseHelper<Commands::ContentAppMessageResponse::Type> &helper,
const chip::Optional<chip::CharSpan> &data, const chip::CharSpan &encodingHint) override;
private:
static constexpr const char * LOG_TAG = "MockContentAppObserverDelegate";
};
} // namespace ContentAppObserver
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,155 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_content_control_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ContentControl {
bool MockContentControlDelegate::HandleGetEnabled()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return false;
}
CHIP_ERROR MockContentControlDelegate::HandleGetOnDemandRatings(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
chip::CharSpan MockContentControlDelegate::HandleGetOnDemandRatingThreshold()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return chip::CharSpan();
}
CHIP_ERROR MockContentControlDelegate::HandleGetScheduledContentRatings(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
chip::CharSpan MockContentControlDelegate::HandleGetScheduledContentRatingThreshold()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return chip::CharSpan();
}
uint32_t MockContentControlDelegate::HandleGetScreenDailyTime()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint32_t MockContentControlDelegate::HandleGetRemainingScreenTime()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
bool MockContentControlDelegate::HandleGetBlockUnrated()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return false;
}
void MockContentControlDelegate::HandleUpdatePIN(chip::CharSpan oldPIN, chip::CharSpan newPIN)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockContentControlDelegate::HandleResetPIN(CommandResponseHelper<Commands::ResetPINResponse::Type> &helper)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::ResetPINResponse::Type response;
helper.Success(response);
}
void MockContentControlDelegate::HandleEnable()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockContentControlDelegate::HandleDisable()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockContentControlDelegate::HandleAddBonusTime(Optional<chip::CharSpan> PINCode, uint32_t bonusTime)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockContentControlDelegate::HandleSetScreenDailyTime(uint32_t screenDailyTime)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockContentControlDelegate::HandleBlockUnratedContent()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockContentControlDelegate::HandleUnblockUnratedContent()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockContentControlDelegate::HandleSetOnDemandRatingThreshold(chip::CharSpan rating)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockContentControlDelegate::HandleSetScheduledContentRatingThreshold(chip::CharSpan rating)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
uint32_t MockContentControlDelegate::GetFeatureMap(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
} // namespace ContentControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,58 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/content-control-server/content-control-delegate.h>
/*
* Mock ContentControl Delegate Implementation
* This file provides a mock implementation of the ContentControl::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/master/src/app/clusters/content-control-server/content-control-delegate.h
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ContentControl {
class MockContentControlDelegate : public Delegate {
public:
MockContentControlDelegate() = default;
bool HandleGetEnabled() override;
CHIP_ERROR HandleGetOnDemandRatings(app::AttributeValueEncoder &aEncoder) override;
chip::CharSpan HandleGetOnDemandRatingThreshold() override;
CHIP_ERROR HandleGetScheduledContentRatings(app::AttributeValueEncoder &aEncoder) override;
chip::CharSpan HandleGetScheduledContentRatingThreshold() override;
uint32_t HandleGetScreenDailyTime() override;
uint32_t HandleGetRemainingScreenTime() override;
bool HandleGetBlockUnrated() override;
void HandleUpdatePIN(chip::CharSpan oldPIN, chip::CharSpan newPIN) override;
void HandleResetPIN(CommandResponseHelper<Commands::ResetPINResponse::Type> &helper) override;
void HandleEnable() override;
void HandleDisable() override;
void HandleAddBonusTime(Optional<chip::CharSpan> PINCode, uint32_t bonusTime) override;
void HandleSetScreenDailyTime(uint32_t screenDailyTime) override;
void HandleBlockUnratedContent() override;
void HandleUnblockUnratedContent() override;
void HandleSetOnDemandRatingThreshold(chip::CharSpan rating) override;
void HandleSetScheduledContentRatingThreshold(chip::CharSpan rating) override;
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
private:
const char *LOG_TAG = "content_control";
};
} // namespace ContentControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,71 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_content_launcher_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ContentLauncher {
void MockContentLauncherDelegate::HandleLaunchContent(CommandResponseHelper<Commands::LauncherResponse::Type> &helper,
const DataModel::DecodableList<Parameter> &parameterList, bool autoplay,
const CharSpan &data, const Optional<PlaybackPreferences> playbackPreferences,
bool useCurrentContext)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::LauncherResponse::Type response;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
void MockContentLauncherDelegate::HandleLaunchUrl(CommandResponseHelper<Commands::LauncherResponse::Type> &helper, const CharSpan &contentUrl,
const CharSpan &displayString, const BrandingInformation &brandingInformation)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::LauncherResponse::Type response;
response.status = StatusEnum::kSuccess;
helper.Success(response);
}
CHIP_ERROR MockContentLauncherDelegate::HandleGetAcceptHeaderList(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
uint32_t MockContentLauncherDelegate::HandleGetSupportedStreamingProtocols()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint32_t MockContentLauncherDelegate::GetFeatureMap(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint16_t MockContentLauncherDelegate::GetClusterRevision(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
} // namespace ContentLauncher
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,52 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/content-launch-server/content-launch-delegate.h>
/*
* Mock ContentLauncher Delegate Implementation
* This file provides a mock implementation of the ContentLauncher::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/content-launch-server/content-launch-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ContentLauncher {
class MockContentLauncherDelegate : public Delegate {
public:
MockContentLauncherDelegate() = default;
void HandleLaunchContent(CommandResponseHelper<Commands::LauncherResponse::Type> &helper,
const DataModel::DecodableList<Parameter> &parameterList, bool autoplay,
const CharSpan &data, const Optional<PlaybackPreferences> playbackPreferences,
bool useCurrentContext) override;
void HandleLaunchUrl(CommandResponseHelper<Commands::LauncherResponse::Type> &helper, const CharSpan &contentUrl,
const CharSpan &displayString, const BrandingInformation &brandingInformation) override;
CHIP_ERROR HandleGetAcceptHeaderList(app::AttributeValueEncoder &aEncoder) override;
uint32_t HandleGetSupportedStreamingProtocols() override;
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
uint16_t GetClusterRevision(chip::EndpointId endpoint) override;
private:
const char *LOG_TAG = "content_launcher";
};
} // namespace ContentLauncher
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,137 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_device_energy_management_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace DeviceEnergyManagement {
Protocols::InteractionModel::Status MockDeviceEnergyManagementDelegate::PowerAdjustRequest(const int64_t power, const uint32_t duration,
AdjustmentCauseEnum cause)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockDeviceEnergyManagementDelegate::CancelPowerAdjustRequest()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockDeviceEnergyManagementDelegate::StartTimeAdjustRequest(const uint32_t requestedStartTime,
AdjustmentCauseEnum cause)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockDeviceEnergyManagementDelegate::PauseRequest(const uint32_t duration, AdjustmentCauseEnum cause)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockDeviceEnergyManagementDelegate::ResumeRequest()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status
MockDeviceEnergyManagementDelegate::ModifyForecastRequest(const uint32_t forecastID,
const DataModel::DecodableList<Structs::SlotAdjustmentStruct::Type> &slotAdjustments,
AdjustmentCauseEnum cause)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status
MockDeviceEnergyManagementDelegate::RequestConstraintBasedForecast(const DataModel::DecodableList<Structs::ConstraintsStruct::Type> &constraints,
AdjustmentCauseEnum cause)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockDeviceEnergyManagementDelegate::CancelRequest()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
ESATypeEnum MockDeviceEnergyManagementDelegate::GetESAType()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return ESATypeEnum::kOther;
}
bool MockDeviceEnergyManagementDelegate::GetESACanGenerate()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return false;
}
ESAStateEnum MockDeviceEnergyManagementDelegate::GetESAState()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return ESAStateEnum::kOffline;
}
int64_t MockDeviceEnergyManagementDelegate::GetAbsMinPower()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
int64_t MockDeviceEnergyManagementDelegate::GetAbsMaxPower()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
OptOutStateEnum MockDeviceEnergyManagementDelegate::GetOptOutState()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return OptOutStateEnum::kNoOptOut;
}
const DataModel::Nullable<Structs::PowerAdjustCapabilityStruct::Type> &MockDeviceEnergyManagementDelegate::GetPowerAdjustmentCapability()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return mPowerAdjustCapability;
}
const DataModel::Nullable<Structs::ForecastStruct::Type> &MockDeviceEnergyManagementDelegate::GetForecast()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return mForecast;
}
CHIP_ERROR MockDeviceEnergyManagementDelegate::SetESAState(ESAStateEnum esaState)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace DeviceEnergyManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,79 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/device-energy-management-server/device-energy-management-server.h>
/*
* Mock DeviceEnergyManagement Delegate Implementation
* This file provides a mock implementation of the DeviceEnergyManagement::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/device-energy-management-server/device-energy-management-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace DeviceEnergyManagement {
class MockDeviceEnergyManagementDelegate : public Delegate {
public:
MockDeviceEnergyManagementDelegate() = default;
virtual ~MockDeviceEnergyManagementDelegate() = default;
// Command handlers
Protocols::InteractionModel::Status PowerAdjustRequest(const int64_t power, const uint32_t duration,
AdjustmentCauseEnum cause) override;
Protocols::InteractionModel::Status CancelPowerAdjustRequest() override;
Protocols::InteractionModel::Status StartTimeAdjustRequest(const uint32_t requestedStartTime,
AdjustmentCauseEnum cause) override;
Protocols::InteractionModel::Status PauseRequest(const uint32_t duration, AdjustmentCauseEnum cause) override;
Protocols::InteractionModel::Status ResumeRequest() override;
Protocols::InteractionModel::Status
ModifyForecastRequest(const uint32_t forecastID,
const DataModel::DecodableList<Structs::SlotAdjustmentStruct::Type> &slotAdjustments,
AdjustmentCauseEnum cause) override;
Protocols::InteractionModel::Status
RequestConstraintBasedForecast(const DataModel::DecodableList<Structs::ConstraintsStruct::Type> &constraints,
AdjustmentCauseEnum cause) override;
Protocols::InteractionModel::Status CancelRequest() override;
// Attribute getters
ESATypeEnum GetESAType() override;
bool GetESACanGenerate() override;
ESAStateEnum GetESAState() override;
int64_t GetAbsMinPower() override;
int64_t GetAbsMaxPower() override;
OptOutStateEnum GetOptOutState() override;
const DataModel::Nullable<Structs::PowerAdjustCapabilityStruct::Type> &GetPowerAdjustmentCapability() override;
const DataModel::Nullable<Structs::ForecastStruct::Type> &GetForecast() override;
// Attribute setter
CHIP_ERROR SetESAState(ESAStateEnum esaState) override;
private:
static constexpr const char * LOG_TAG = "MockDeviceEnergyManagementDelegate";
DataModel::Nullable<Structs::PowerAdjustCapabilityStruct::Type> mPowerAdjustCapability;
DataModel::Nullable<Structs::ForecastStruct::Type> mForecast;
};
} // namespace DeviceEnergyManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,35 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_dishwasher_alarm_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace DishwasherAlarm {
bool MockDishwasherAlarmDelegate::ModifyEnabledAlarmsCallback(const BitMask<AlarmMap> mask)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockDishwasherAlarmDelegate::ResetAlarmsCallback(const BitMask<AlarmMap> alarms)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
} // namespace DishwasherAlarm
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,44 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/dishwasher-alarm-server/dishwasher-alarm-delegate.h>
/*
* Mock DishwasherAlarm Delegate Implementation
* This file provides a mock implementation of the DishwasherAlarm::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace DishwasherAlarm {
class MockDishwasherAlarmDelegate : public Delegate {
public:
MockDishwasherAlarmDelegate() : Delegate() {}
MockDishwasherAlarmDelegate(EndpointId endpoint) : Delegate(endpoint) {}
virtual ~MockDishwasherAlarmDelegate() = default;
// Dishwasher alarm callbacks
bool ModifyEnabledAlarmsCallback(const BitMask<AlarmMap> mask) override;
bool ResetAlarmsCallback(const BitMask<AlarmMap> alarms) override;
private:
static constexpr const char * LOG_TAG = "MockDishwasherAlarmDelegate";
};
} // namespace DishwasherAlarm
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,102 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_door_lock_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace DoorLock {
CHIP_ERROR MockDoorLockDelegate::GetAliroReaderVerificationKey(MutableByteSpan &verificationKey)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
verificationKey.reduce_size(0);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockDoorLockDelegate::GetAliroReaderGroupIdentifier(MutableByteSpan &groupIdentifier)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
groupIdentifier.reduce_size(0);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockDoorLockDelegate::GetAliroReaderGroupSubIdentifier(MutableByteSpan &groupSubIdentifier)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
CHIP_ERROR MockDoorLockDelegate::GetAliroExpeditedTransactionSupportedProtocolVersionAtIndex(size_t index, MutableByteSpan &protocolVersion)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockDoorLockDelegate::GetAliroGroupResolvingKey(MutableByteSpan &groupResolvingKey)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
groupResolvingKey.reduce_size(0);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockDoorLockDelegate::GetAliroSupportedBLEUWBProtocolVersionAtIndex(size_t index, MutableByteSpan &protocolVersion)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
uint8_t MockDoorLockDelegate::GetAliroBLEAdvertisingVersion()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint16_t MockDoorLockDelegate::GetNumberOfAliroCredentialIssuerKeysSupported()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint16_t MockDoorLockDelegate::GetNumberOfAliroEndpointKeysSupported()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockDoorLockDelegate::SetAliroReaderConfig(const ByteSpan &signingKey, const ByteSpan &verificationKey,
const ByteSpan &groupIdentifier, const Optional<ByteSpan> &groupResolvingKey)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockDoorLockDelegate::ClearAliroReaderConfig()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace DoorLock
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,52 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/door-lock-server/door-lock-delegate.h>
/*
* Mock DoorLock Delegate Implementation
* This file provides a mock implementation of the DoorLock::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/door-lock-server/door-lock-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/lock-app/lock-common/include/LockEndpoint.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/lock-app/lock-common/src/LockEndpoint.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace DoorLock {
class MockDoorLockDelegate : public Delegate {
public:
MockDoorLockDelegate() = default;
CHIP_ERROR GetAliroReaderVerificationKey(MutableByteSpan &verificationKey) override;
CHIP_ERROR GetAliroReaderGroupIdentifier(MutableByteSpan &groupIdentifier) override;
CHIP_ERROR GetAliroReaderGroupSubIdentifier(MutableByteSpan &groupSubIdentifier) override;
CHIP_ERROR GetAliroExpeditedTransactionSupportedProtocolVersionAtIndex(size_t index, MutableByteSpan &protocolVersion) override;
CHIP_ERROR GetAliroGroupResolvingKey(MutableByteSpan &groupResolvingKey) override;
CHIP_ERROR GetAliroSupportedBLEUWBProtocolVersionAtIndex(size_t index, MutableByteSpan &protocolVersion) override;
uint8_t GetAliroBLEAdvertisingVersion() override;
uint16_t GetNumberOfAliroCredentialIssuerKeysSupported() override;
uint16_t GetNumberOfAliroEndpointKeysSupported() override;
CHIP_ERROR SetAliroReaderConfig(const ByteSpan &signingKey, const ByteSpan &verificationKey,
const ByteSpan &groupIdentifier, const Optional<ByteSpan> &groupResolvingKey) override;
CHIP_ERROR ClearAliroReaderConfig() override;
private:
const char *LOG_TAG = "door_lock";
};
} // namespace DoorLock
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,24 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_electrical_grid_conditions_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ElectricalGridConditions {
// Note: This is a placeholder delegate with no delegated methods currently
// The implementation is empty as there are no virtual methods to override
} // namespace ElectricalGridConditions
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,43 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/electrical-grid-conditions-server/electrical-grid-conditions-server.h>
/*
* Mock ElectricalGridConditions Delegate Implementation
* This file provides a mock implementation of the ElectricalGridConditions::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/electrical-grid-conditions-server/electrical-grid-conditions-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-gateway-app/electrical-grid-conditions/include/ElectricalGridConditionsDelegate.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-gateway-app/electrical-grid-conditions/src/ElectricalGridConditionsDelegate.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ElectricalGridConditions {
class MockElectricalGridConditionsDelegate : public Delegate {
public:
MockElectricalGridConditionsDelegate() : Delegate() {}
virtual ~MockElectricalGridConditionsDelegate() = default;
// Electrical grid conditions management
// Note: This is a placeholder delegate with no delegated methods currently
private:
static constexpr const char * LOG_TAG = "MockElectricalGridConditionsDelegate";
};
} // namespace ElectricalGridConditions
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,210 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_electrical_power_measurement_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ElectricalPowerMeasurement {
PowerModeEnum MockElectricalPowerMeasurementDelegate::GetPowerMode()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return PowerModeEnum::kUnknownEnumValue;
}
uint8_t MockElectricalPowerMeasurementDelegate::GetNumberOfMeasurementTypes()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::StartAccuracyRead()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::GetAccuracyByIndex(uint8_t index, Structs::MeasurementAccuracyStruct::Type &accuracy)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::EndAccuracyRead()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::StartRangesRead()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::GetRangeByIndex(uint8_t index, Structs::MeasurementRangeStruct::Type &range)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::EndRangesRead()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::StartHarmonicCurrentsRead()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::GetHarmonicCurrentsByIndex(uint8_t index, Structs::HarmonicMeasurementStruct::Type &harmonic)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::EndHarmonicCurrentsRead()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::StartHarmonicPhasesRead()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::GetHarmonicPhasesByIndex(uint8_t index, Structs::HarmonicMeasurementStruct::Type &harmonic)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockElectricalPowerMeasurementDelegate::EndHarmonicPhasesRead()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetVoltage()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetActiveCurrent()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetReactiveCurrent()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetApparentCurrent()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetActivePower()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetReactivePower()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetApparentPower()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetRMSVoltage()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetRMSCurrent()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetRMSPower()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetFrequency()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetPowerFactor()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockElectricalPowerMeasurementDelegate::GetNeutralCurrent()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
} // namespace ElectricalPowerMeasurement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,73 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/electrical-power-measurement-server/ElectricalPowerMeasurementCluster.h>
/*
* Mock ElectricalPowerMeasurement Delegate Implementation
* This file provides a mock implementation of the ElectricalPowerMeasurement::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/electrical-power-measurement-server/electrical-power-measurement-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/energy-reporting/include/ElectricalPowerMeasurementDelegate.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/energy-reporting/src/ElectricalPowerMeasurementDelegate.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ElectricalPowerMeasurement {
class MockElectricalPowerMeasurementDelegate : public Delegate {
public:
MockElectricalPowerMeasurementDelegate() = default;
virtual ~MockElectricalPowerMeasurementDelegate() = default;
// Delegate interface
PowerModeEnum GetPowerMode() override;
uint8_t GetNumberOfMeasurementTypes() override;
CHIP_ERROR StartAccuracyRead() override;
CHIP_ERROR GetAccuracyByIndex(uint8_t index, Structs::MeasurementAccuracyStruct::Type &accuracy) override;
CHIP_ERROR EndAccuracyRead() override;
CHIP_ERROR StartRangesRead() override;
CHIP_ERROR GetRangeByIndex(uint8_t index, Structs::MeasurementRangeStruct::Type &range) override;
CHIP_ERROR EndRangesRead() override;
CHIP_ERROR StartHarmonicCurrentsRead() override;
CHIP_ERROR GetHarmonicCurrentsByIndex(uint8_t index, Structs::HarmonicMeasurementStruct::Type &harmonic) override;
CHIP_ERROR EndHarmonicCurrentsRead() override;
CHIP_ERROR StartHarmonicPhasesRead() override;
CHIP_ERROR GetHarmonicPhasesByIndex(uint8_t index, Structs::HarmonicMeasurementStruct::Type &harmonic) override;
CHIP_ERROR EndHarmonicPhasesRead() override;
DataModel::Nullable<int64_t> GetVoltage() override;
DataModel::Nullable<int64_t> GetActiveCurrent() override;
DataModel::Nullable<int64_t> GetReactiveCurrent() override;
DataModel::Nullable<int64_t> GetApparentCurrent() override;
DataModel::Nullable<int64_t> GetActivePower() override;
DataModel::Nullable<int64_t> GetReactivePower() override;
DataModel::Nullable<int64_t> GetApparentPower() override;
DataModel::Nullable<int64_t> GetRMSVoltage() override;
DataModel::Nullable<int64_t> GetRMSCurrent() override;
DataModel::Nullable<int64_t> GetRMSPower() override;
DataModel::Nullable<int64_t> GetFrequency() override;
DataModel::Nullable<int64_t> GetPowerFactor() override;
DataModel::Nullable<int64_t> GetNeutralCurrent() override;
private:
static constexpr const char * LOG_TAG = "MockElectricalPowerMeasurementDelegate";
};
} // namespace ElectricalPowerMeasurement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,217 @@
#include "mock_energy_evse_delegate.h"
#include "esp_log.h"
namespace chip {
namespace app {
namespace Clusters {
namespace EnergyEvse {
Protocols::InteractionModel::Status MockEnergyEVSEDelegate::Disable()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockEnergyEVSEDelegate::EnableCharging(const DataModel::Nullable<uint32_t> &enableChargeTime, const int64_t &minimumChargeCurrent,
const int64_t &maximumChargeCurrent)
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockEnergyEVSEDelegate::EnableDischarging(const DataModel::Nullable<uint32_t> &enableDischargeTime, const int64_t &maximumDischargeCurrent)
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockEnergyEVSEDelegate::StartDiagnostics()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockEnergyEVSEDelegate::SetTargets(const DataModel::DecodableList<Structs::ChargingTargetScheduleStruct::DecodableType> &chargingTargetSchedules)
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockEnergyEVSEDelegate::LoadTargets()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockEnergyEVSEDelegate::GetTargets(DataModel::List<const Structs::ChargingTargetScheduleStruct::Type> &chargingTargetSchedules)
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockEnergyEVSEDelegate::ClearTargets()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
StateEnum MockEnergyEVSEDelegate::GetState()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return StateEnum::kUnknownEnumValue;
}
SupplyStateEnum MockEnergyEVSEDelegate::GetSupplyState()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return SupplyStateEnum::kUnknownEnumValue;
}
FaultStateEnum MockEnergyEVSEDelegate::GetFaultState()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return FaultStateEnum::kNoError;
}
DataModel::Nullable<uint32_t> MockEnergyEVSEDelegate::GetChargingEnabledUntil()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<uint32_t>();
}
DataModel::Nullable<uint32_t> MockEnergyEVSEDelegate::GetDischargingEnabledUntil()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<uint32_t>();
}
int64_t MockEnergyEVSEDelegate::GetCircuitCapacity()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
int64_t MockEnergyEVSEDelegate::GetMinimumChargeCurrent()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
int64_t MockEnergyEVSEDelegate::GetMaximumChargeCurrent()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
int64_t MockEnergyEVSEDelegate::GetMaximumDischargeCurrent()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
int64_t MockEnergyEVSEDelegate::GetUserMaximumChargeCurrent()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint32_t MockEnergyEVSEDelegate::GetRandomizationDelayWindow()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
DataModel::Nullable<uint32_t> MockEnergyEVSEDelegate::GetNextChargeStartTime()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<uint32_t>();
}
DataModel::Nullable<uint32_t> MockEnergyEVSEDelegate::GetNextChargeTargetTime()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<uint32_t>();
}
DataModel::Nullable<int64_t> MockEnergyEVSEDelegate::GetNextChargeRequiredEnergy()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<Percent> MockEnergyEVSEDelegate::GetNextChargeTargetSoC()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<Percent>();
}
DataModel::Nullable<uint16_t> MockEnergyEVSEDelegate::GetApproximateEVEfficiency()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<uint16_t>();
}
DataModel::Nullable<Percent> MockEnergyEVSEDelegate::GetStateOfCharge()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<Percent>();
}
DataModel::Nullable<int64_t> MockEnergyEVSEDelegate::GetBatteryCapacity()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<CharSpan> MockEnergyEVSEDelegate::GetVehicleID()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<CharSpan>();
}
DataModel::Nullable<uint32_t> MockEnergyEVSEDelegate::GetSessionID()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<uint32_t>();
}
DataModel::Nullable<uint32_t> MockEnergyEVSEDelegate::GetSessionDuration()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<uint32_t>();
}
DataModel::Nullable<int64_t> MockEnergyEVSEDelegate::GetSessionEnergyCharged()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
DataModel::Nullable<int64_t> MockEnergyEVSEDelegate::GetSessionEnergyDischarged()
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<int64_t>();
}
CHIP_ERROR MockEnergyEVSEDelegate::SetUserMaximumChargeCurrent(int64_t aNewValue)
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockEnergyEVSEDelegate::SetRandomizationDelayWindow(uint32_t aNewValue)
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockEnergyEVSEDelegate::SetApproximateEVEfficiency(DataModel::Nullable<uint16_t> aNewValue)
{
ESP_LOGI(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace EnergyEvse
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,98 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/energy-evse-server/energy-evse-server.h>
/*
* Mock EnergyEVSE Delegate Implementation
* This file provides a mock implementation of the EnergyEVSE::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/energy-evse-server/energy-evse-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/energy-evse/include/EnergyEvseDelegateImpl.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseDelegateImpl.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace EnergyEvse {
class MockEnergyEVSEDelegate : public Delegate {
public:
MockEnergyEVSEDelegate() = default;
Protocols::InteractionModel::Status Disable() override;
Protocols::InteractionModel::Status EnableCharging(const DataModel::Nullable<uint32_t> &enableChargeTime,
const int64_t &minimumChargeCurrent,
const int64_t &maximumChargeCurrent) override;
Protocols::InteractionModel::Status EnableDischarging(const DataModel::Nullable<uint32_t> &enableDischargeTime,
const int64_t &maximumDischargeCurrent) override;
Protocols::InteractionModel::Status StartDiagnostics() override;
Protocols::InteractionModel::Status
SetTargets(const DataModel::DecodableList<Structs::ChargingTargetScheduleStruct::DecodableType> &chargingTargetSchedules) override;
Protocols::InteractionModel::Status LoadTargets() override;
Protocols::InteractionModel::Status
GetTargets(DataModel::List<const Structs::ChargingTargetScheduleStruct::Type> &chargingTargetSchedules) override;
Protocols::InteractionModel::Status ClearTargets() override;
// ------------------------------------------------------------------
// Get attribute methods
StateEnum GetState() override;
SupplyStateEnum GetSupplyState() override;
FaultStateEnum GetFaultState() override;
DataModel::Nullable<uint32_t> GetChargingEnabledUntil() override;
DataModel::Nullable<uint32_t> GetDischargingEnabledUntil() override;
int64_t GetCircuitCapacity() override;
int64_t GetMinimumChargeCurrent() override;
int64_t GetMaximumChargeCurrent() override;
int64_t GetMaximumDischargeCurrent() override;
int64_t GetUserMaximumChargeCurrent() override;
uint32_t GetRandomizationDelayWindow() override;
/* PREF attributes */
DataModel::Nullable<uint32_t> GetNextChargeStartTime() override;
DataModel::Nullable<uint32_t> GetNextChargeTargetTime() override;
DataModel::Nullable<int64_t> GetNextChargeRequiredEnergy() override;
DataModel::Nullable<Percent> GetNextChargeTargetSoC() override;
DataModel::Nullable<uint16_t> GetApproximateEVEfficiency() override;
/* SOC attributes */
DataModel::Nullable<Percent> GetStateOfCharge() override;
DataModel::Nullable<int64_t> GetBatteryCapacity() override;
/* PNC attributes*/
DataModel::Nullable<CharSpan> GetVehicleID() override;
/* Session SESS attributes */
DataModel::Nullable<uint32_t> GetSessionID() override;
DataModel::Nullable<uint32_t> GetSessionDuration() override;
DataModel::Nullable<int64_t> GetSessionEnergyCharged() override;
DataModel::Nullable<int64_t> GetSessionEnergyDischarged() override;
// ------------------------------------------------------------------
// Set attribute methods
CHIP_ERROR SetUserMaximumChargeCurrent(int64_t aNewValue) override;
CHIP_ERROR SetRandomizationDelayWindow(uint32_t aNewValue) override;
CHIP_ERROR SetApproximateEVEfficiency(DataModel::Nullable<uint16_t> aNewValue) override;
private:
static constexpr const char * LOG_TAG = "energy-evse";
};
} // namespace EnergyEvse
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,28 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_fan_control_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace FanControl {
Protocols::InteractionModel::Status MockFanControlDelegate::HandleStep(StepDirectionEnum aDirection, bool aWrap, bool aLowestOff)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
} // namespace FanControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,44 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/fan-control-server/fan-control-delegate.h>
#include <protocols/interaction_model/StatusCode.h>
/*
* Mock FanControl Delegate Implementation
* This file provides a mock implementation of the FanControl::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/fan-control-server/fan-control-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace FanControl {
class MockFanControlDelegate : public Delegate {
public:
MockFanControlDelegate() : Delegate(kInvalidEndpointId) {}
MockFanControlDelegate(EndpointId aEndpoint) : Delegate(aEndpoint) {}
virtual ~MockFanControlDelegate() = default;
// Fan control command handlers
Protocols::InteractionModel::Status HandleStep(StepDirectionEnum aDirection, bool aWrap, bool aLowestOff) override;
private:
static constexpr const char * LOG_TAG = "MockFanControlDelegate";
};
} // namespace FanControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,37 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_keypad_input_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace KeypadInput {
void MockKeypadInputDelegate::HandleSendKey(CommandResponseHelper<Commands::SendKeyResponse::Type> &helper, const CECKeyCodeEnum &keyCode)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::SendKeyResponse::Type response;
response.status = KeypadInputStatusEnum::kSuccess;
helper.Success(response);
}
uint32_t MockKeypadInputDelegate::GetFeatureMap(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
} // namespace KeypadInput
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,44 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/keypad-input-server/keypad-input-delegate.h>
/*
* Mock KeypadInput Delegate Implementation
* This file provides a mock implementation of the KeypadInput::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/keypad-input-server/keypad-input-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/keypad-input/KeypadInputManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace KeypadInput {
class MockKeypadInputDelegate : public Delegate {
public:
MockKeypadInputDelegate() = default;
void HandleSendKey(CommandResponseHelper<Commands::SendKeyResponse::Type> &helper, const CECKeyCodeEnum &keyCode) override;
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
private:
const char *LOG_TAG = "keypad_input";
};
} // namespace KeypadInput
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,28 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_laundry_dryer_controls_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace LaundryDryerControls {
CHIP_ERROR MockLaundryDryerControlsDelegate::GetSupportedDrynessLevelAtIndex(size_t index, DrynessLevelEnum &supportedDryness)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
} // namespace LaundryDryerControls
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,43 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-delegate.h>
/*
* Mock LaundryDryerControls Delegate Implementation
* This file provides a mock implementation of the LaundryDryerControls::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/laundry-dryer-controls-delegate-impl.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/laundry-dryer-controls-delegate-impl.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace LaundryDryerControls {
class MockLaundryDryerControlsDelegate : public Delegate {
public:
MockLaundryDryerControlsDelegate() : Delegate() {}
virtual ~MockLaundryDryerControlsDelegate() = default;
// Laundry dryer controls management
CHIP_ERROR GetSupportedDrynessLevelAtIndex(size_t index, DrynessLevelEnum &supportedDryness) override;
private:
static constexpr const char * LOG_TAG = "MockLaundryDryerControlsDelegate";
};
} // namespace LaundryDryerControls
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,35 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_laundry_washer_controls_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace LaundryWasherControls {
CHIP_ERROR MockLaundryWasherControlsDelegate::GetSpinSpeedAtIndex(size_t index, MutableCharSpan &spinSpeed)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockLaundryWasherControlsDelegate::GetSupportedRinseAtIndex(size_t index, NumberOfRinsesEnum &supportedRinse)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
} // namespace LaundryWasherControls
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,44 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/laundry-washer-controls-server/laundry-washer-controls-delegate.h>
/*
* Mock LaundryWasherControls Delegate Implementation
* This file provides a mock implementation of the LaundryWasherControls::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/laundry-washer-controls-delegate-impl.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/laundry-washer-controls-delegate-impl.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace LaundryWasherControls {
class MockLaundryWasherControlsDelegate : public Delegate {
public:
MockLaundryWasherControlsDelegate() : Delegate() {}
virtual ~MockLaundryWasherControlsDelegate() = default;
// Laundry washer controls management
CHIP_ERROR GetSpinSpeedAtIndex(size_t index, MutableCharSpan &spinSpeed) override;
CHIP_ERROR GetSupportedRinseAtIndex(size_t index, NumberOfRinsesEnum &supportedRinse) override;
private:
static constexpr const char * LOG_TAG = "MockLaundryWasherControlsDelegate";
};
} // namespace LaundryWasherControls
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,28 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_low_power_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace LowPower {
bool MockLowPowerDelegate::HandleSleep()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
} // namespace LowPower
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,41 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/low-power-server/low-power-delegate.h>
/*
* Mock LowPower Delegate Implementation
* This file provides a mock implementation of the LowPower::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/low-power-server/low-power-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/low-power/LowPowerManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/low-power/LowPowerManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace LowPower {
class MockLowPowerDelegate : public Delegate {
public:
MockLowPowerDelegate() = default;
bool HandleSleep() override;
private:
const char *LOG_TAG = "low_power";
};
} // namespace LowPower
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,63 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_media_input_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace MediaInput {
CHIP_ERROR MockMediaInputDelegate::HandleGetInputList(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
uint8_t MockMediaInputDelegate::HandleGetCurrentInput()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
bool MockMediaInputDelegate::HandleSelectInput(const uint8_t index)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockMediaInputDelegate::HandleShowInputStatus()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockMediaInputDelegate::HandleHideInputStatus()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockMediaInputDelegate::HandleRenameInput(const uint8_t index, const chip::CharSpan &name)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
} // namespace MediaInput
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,46 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/media-input-server/media-input-delegate.h>
/*
* Mock MediaInput Delegate Implementation
* This file provides a mock implementation of the MediaInput::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/media-input-server/media-input-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/media-input/MediaInputManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/media-input/MediaInputManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace MediaInput {
class MockMediaInputDelegate : public Delegate {
public:
MockMediaInputDelegate() = default;
CHIP_ERROR HandleGetInputList(app::AttributeValueEncoder &aEncoder) override;
uint8_t HandleGetCurrentInput() override;
bool HandleSelectInput(const uint8_t index) override;
bool HandleShowInputStatus() override;
bool HandleHideInputStatus() override;
bool HandleRenameInput(const uint8_t index, const chip::CharSpan &name) override;
private:
const char *LOG_TAG = "media_input";
};
} // namespace MediaInput
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,237 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_media_playback_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace MediaPlayback {
PlaybackStateEnum MockMediaPlaybackDelegate::HandleGetCurrentState()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return PlaybackStateEnum::kPlaying;
}
uint64_t MockMediaPlaybackDelegate::HandleGetStartTime()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint64_t MockMediaPlaybackDelegate::HandleGetDuration()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockMediaPlaybackDelegate::HandleGetSampledPosition(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
float MockMediaPlaybackDelegate::HandleGetPlaybackSpeed()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 1.0f;
}
uint64_t MockMediaPlaybackDelegate::HandleGetSeekRangeStart()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint64_t MockMediaPlaybackDelegate::HandleGetSeekRangeEnd()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockMediaPlaybackDelegate::HandleGetActiveAudioTrack(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
CHIP_ERROR MockMediaPlaybackDelegate::HandleGetAvailableAudioTracks(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
CHIP_ERROR MockMediaPlaybackDelegate::HandleGetActiveTextTrack(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
CHIP_ERROR MockMediaPlaybackDelegate::HandleGetAvailableTextTracks(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
void MockMediaPlaybackDelegate::HandlePlay(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandlePause(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandleStop(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandleFastForward(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const chip::Optional<bool> &audioAdvanceUnmuted)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandlePrevious(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandleRewind(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const chip::Optional<bool> &audioAdvanceUnmuted)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandleSkipBackward(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const uint64_t &deltaPositionMilliseconds)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandleSkipForward(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const uint64_t &deltaPositionMilliseconds)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandleSeek(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const uint64_t &positionMilliseconds)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandleNext(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
void MockMediaPlaybackDelegate::HandleStartOver(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::PlaybackResponse::Type response;
response.status = MediaPlaybackStatusEnum::kSuccess;
helper.Success(response);
}
bool MockMediaPlaybackDelegate::HandleActivateAudioTrack(const chip::CharSpan &trackId, const uint8_t &audioOutputIndex)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockMediaPlaybackDelegate::HandleActivateTextTrack(const chip::CharSpan &trackId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockMediaPlaybackDelegate::HandleDeactivateTextTrack()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
uint32_t MockMediaPlaybackDelegate::GetFeatureMap(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint16_t MockMediaPlaybackDelegate::GetClusterRevision(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
} // namespace MediaPlayback
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,74 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/media-playback-server/media-playback-delegate.h>
/*
* Mock MediaPlayback Delegate Implementation
* This file provides a mock implementation of the MediaPlayback::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/media-playback-server/media-playback-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace MediaPlayback {
class MockMediaPlaybackDelegate : public Delegate {
public:
MockMediaPlaybackDelegate() = default;
PlaybackStateEnum HandleGetCurrentState() override;
uint64_t HandleGetStartTime() override;
uint64_t HandleGetDuration() override;
CHIP_ERROR HandleGetSampledPosition(app::AttributeValueEncoder &aEncoder) override;
float HandleGetPlaybackSpeed() override;
uint64_t HandleGetSeekRangeStart() override;
uint64_t HandleGetSeekRangeEnd() override;
CHIP_ERROR HandleGetActiveAudioTrack(app::AttributeValueEncoder &aEncoder) override;
CHIP_ERROR HandleGetAvailableAudioTracks(app::AttributeValueEncoder &aEncoder) override;
CHIP_ERROR HandleGetActiveTextTrack(app::AttributeValueEncoder &aEncoder) override;
CHIP_ERROR HandleGetAvailableTextTracks(app::AttributeValueEncoder &aEncoder) override;
void HandlePlay(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper) override;
void HandlePause(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper) override;
void HandleStop(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper) override;
void HandleFastForward(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const chip::Optional<bool> &audioAdvanceUnmuted) override;
void HandlePrevious(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper) override;
void HandleRewind(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const chip::Optional<bool> &audioAdvanceUnmuted) override;
void HandleSkipBackward(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const uint64_t &deltaPositionMilliseconds) override;
void HandleSkipForward(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const uint64_t &deltaPositionMilliseconds) override;
void HandleSeek(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper,
const uint64_t &positionMilliseconds) override;
void HandleNext(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper) override;
void HandleStartOver(CommandResponseHelper<Commands::PlaybackResponse::Type> &helper) override;
bool HandleActivateAudioTrack(const chip::CharSpan &trackId, const uint8_t &audioOutputIndex) override;
bool HandleActivateTextTrack(const chip::CharSpan &trackId) override;
bool HandleDeactivateTextTrack() override;
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
uint16_t GetClusterRevision(chip::EndpointId endpoint) override;
private:
const char *LOG_TAG = "media_playback";
};
} // namespace MediaPlayback
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,61 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_messages_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace Messages {
CHIP_ERROR MockMessagesDelegate::HandlePresentMessagesRequest(
const ByteSpan &messageId, const MessagePriorityEnum &priority,
const chip::BitMask<MessageControlBitmap> &messageControl, const DataModel::Nullable<uint32_t> &startTime,
const DataModel::Nullable<uint64_t> &duration, const CharSpan &messageText,
const chip::Optional<DataModel::DecodableList<chip::app::Clusters::Messages::Structs::MessageResponseOptionStruct::Type>> &
responses)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockMessagesDelegate::HandleCancelMessagesRequest(const DataModel::DecodableList<chip::ByteSpan> &messageIds)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockMessagesDelegate::HandleGetMessages(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
CHIP_ERROR MockMessagesDelegate::HandleGetActiveMessageIds(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
uint32_t MockMessagesDelegate::GetFeatureMap(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
} // namespace Messages
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,52 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/messages-server/messages-delegate.h>
/*
* Mock Messages Delegate Implementation
* This file provides a mock implementation of the Messages::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/messages-server/messages-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/messages/MessagesManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/messages/MessagesManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace Messages {
class MockMessagesDelegate : public Delegate {
public:
MockMessagesDelegate() = default;
CHIP_ERROR HandlePresentMessagesRequest(
const ByteSpan &messageId, const MessagePriorityEnum &priority,
const chip::BitMask<MessageControlBitmap> &messageControl, const DataModel::Nullable<uint32_t> &startTime,
const DataModel::Nullable<uint64_t> &duration, const CharSpan &messageText,
const chip::Optional<DataModel::DecodableList<chip::app::Clusters::Messages::Structs::MessageResponseOptionStruct::Type>> &
responses) override;
CHIP_ERROR HandleCancelMessagesRequest(const DataModel::DecodableList<chip::ByteSpan> &messageIds) override;
CHIP_ERROR HandleGetMessages(app::AttributeValueEncoder &aEncoder) override;
CHIP_ERROR HandleGetActiveMessageIds(app::AttributeValueEncoder &aEncoder) override;
uint32_t GetFeatureMap(chip::EndpointId endpoint) override;
private:
const char *LOG_TAG = "messages";
};
} // namespace Messages
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,94 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_microwave_oven_control_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace MicrowaveOvenControl {
Protocols::InteractionModel::Status MockMicrowaveOvenControlDelegate::HandleSetCookingParametersCallback(uint8_t cookMode, uint32_t cookTimeSec,
bool startAfterSetting,
Optional<uint8_t> powerSettingNum,
Optional<uint8_t> wattSettingIndex)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockMicrowaveOvenControlDelegate::HandleModifyCookTimeSecondsCallback(uint32_t finalCookTimeSec)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR MockMicrowaveOvenControlDelegate::GetWattSettingByIndex(uint8_t index, uint16_t &wattSetting)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
uint32_t MockMicrowaveOvenControlDelegate::GetMaxCookTimeSec() const
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint8_t MockMicrowaveOvenControlDelegate::GetPowerSettingNum() const
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint8_t MockMicrowaveOvenControlDelegate::GetMinPowerNum() const
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint8_t MockMicrowaveOvenControlDelegate::GetMaxPowerNum() const
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint8_t MockMicrowaveOvenControlDelegate::GetPowerStepNum() const
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint8_t MockMicrowaveOvenControlDelegate::GetCurrentWattIndex() const
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint16_t MockMicrowaveOvenControlDelegate::GetWattRating() const
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
} // namespace MicrowaveOvenControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,57 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/microwave-oven-control-server/microwave-oven-control-server.h>
/*
* Mock MicrowaveOvenControl Delegate Implementation
* This file provides a mock implementation of the MicrowaveOvenControl::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/microwave-oven-app/microwave-oven-common/src/microwave-oven-device.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace MicrowaveOvenControl {
class MockMicrowaveOvenControlDelegate : public Delegate {
public:
MockMicrowaveOvenControlDelegate() = default;
virtual ~MockMicrowaveOvenControlDelegate() = default;
// Delegate interface
Protocols::InteractionModel::Status HandleSetCookingParametersCallback(uint8_t cookMode, uint32_t cookTimeSec,
bool startAfterSetting,
Optional<uint8_t> powerSettingNum,
Optional<uint8_t> wattSettingIndex) override;
Protocols::InteractionModel::Status HandleModifyCookTimeSecondsCallback(uint32_t finalCookTimeSec) override;
CHIP_ERROR GetWattSettingByIndex(uint8_t index, uint16_t &wattSetting) override;
uint32_t GetMaxCookTimeSec() const override;
uint8_t GetPowerSettingNum() const override;
uint8_t GetMinPowerNum() const override;
uint8_t GetMaxPowerNum() const override;
uint8_t GetPowerStepNum() const override;
uint8_t GetCurrentWattIndex() const override;
uint16_t GetWattRating() const override;
private:
static constexpr const char * LOG_TAG = "MockMicrowaveOvenControlDelegate";
};
} // namespace MicrowaveOvenControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,57 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_mode_base_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ModeBase {
CHIP_ERROR MockModeBaseDelegate::Init()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockModeBaseDelegate::GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan &label)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockModeBaseDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t &value)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockModeBaseDelegate::GetModeTagsByIndex(uint8_t modeIndex, DataModel::List<detail::Structs::ModeTagStruct::Type> &modeTags)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
void MockModeBaseDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type &response)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
response.status = to_underlying(StatusCode::kSuccess);
return;
}
} // namespace ModeBase
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,82 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
/*
* Mock Delegate for all clusters derived from ModeBase cluster:
* ModeEVSE, ModeOven, ModeRVSRun, ModeRVSClean, ModeDishwasher, ModeWaterHeater, ModeRefrigerator, ModeLaundryWasher and ModeMicrowaveOven clusters.
* This file provides a mock implementation of the ModeBase Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface:
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/mode-base-server/mode-base-server.h
* 2. Delegate Implementation:
* ModeEVSE:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/energy-evse/include/energy-evse-modes.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/energy-evse/src/energy-evse-mode.cpp
*
* ModeOven:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/oven-modes.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp
*
* ModeRVSRun, ModeRVSClean:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp
*
* ModeDishwasher:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/dishwasher-mode.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/dishwasher-mode.cpp
*
* ModeWaterHeater:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/water-heater/include/water-heater-mode.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/water-heater/src/water-heater-mode.cpp
*
* ModeRefrigerator:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/tcc-mode.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/tcc-mode.cpp
*
* ModeLaundryWasher:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/laundry-washer-mode.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/laundry-washer-mode.cpp
*
* ModeRefrigerator:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/microwave-oven-mode.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/microwave-oven-mode.cpp
*
* ModeDeviceEnergyManagement:
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/device-energy-management/include/device-energy-management-modes.h
* https://github.com/espressif/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp
*
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ModeBase {
class MockModeBaseDelegate : public Delegate {
public:
MockModeBaseDelegate() = default;
CHIP_ERROR Init() override;
CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan &label) override;
CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t &value) override;
CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List<detail::Structs::ModeTagStruct::Type> &modeTags) override;
void HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type &response) override;
private:
const char *LOG_TAG = "mode_base";
};
} // namespace ModeBase
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,74 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_operational_state_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace OperationalState {
app::DataModel::Nullable<uint32_t> MockOperationalStateDelegate::GetCountdownTime()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return app::DataModel::Nullable<uint32_t>();
}
CHIP_ERROR MockOperationalStateDelegate::GetOperationalStateAtIndex(size_t index, GenericOperationalState &operationalState)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
CHIP_ERROR MockOperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan &operationalPhase)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
void MockOperationalStateDelegate::HandlePauseStateCallback(GenericOperationalError &err)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
err.Set(to_underlying(ErrorStateEnum::kNoError));
return;
}
void MockOperationalStateDelegate::HandleResumeStateCallback(GenericOperationalError &err)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
err.Set(to_underlying(ErrorStateEnum::kNoError));
return;
}
void MockOperationalStateDelegate::HandleStartStateCallback(GenericOperationalError &err)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
err.Set(to_underlying(ErrorStateEnum::kNoError));
return;
}
void MockOperationalStateDelegate::HandleStopStateCallback(GenericOperationalError &err)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
err.Set(to_underlying(ErrorStateEnum::kNoError));
return;
}
} // namespace OperationalState
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,52 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/operational-state-server/operational-state-server.h>
#include <utility>
/*
* Mock OperationalState Delegate Implementation
* This file provides a mock implementation of the OperationalState::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/operational-state-server/operational-state-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace OperationalState {
class MockOperationalStateDelegate : public Delegate {
public:
MockOperationalStateDelegate() = default;
virtual ~MockOperationalStateDelegate() = default;
// Operational state management
app::DataModel::Nullable<uint32_t> GetCountdownTime() override;
CHIP_ERROR GetOperationalStateAtIndex(size_t index, GenericOperationalState &operationalState) override;
CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, MutableCharSpan &operationalPhase) override;
// Command callbacks
void HandlePauseStateCallback(GenericOperationalError &err) override;
void HandleResumeStateCallback(GenericOperationalError &err) override;
void HandleStartStateCallback(GenericOperationalError &err) override;
void HandleStopStateCallback(GenericOperationalError &err) override;
private:
static constexpr const char * LOG_TAG = "MockOperationalStateDelegate";
};
} // namespace OperationalState
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,35 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_power_topology_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace PowerTopology {
CHIP_ERROR MockPowerTopologyDelegate::GetAvailableEndpointAtIndex(size_t index, EndpointId &endpointId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockPowerTopologyDelegate::GetActiveEndpointAtIndex(size_t index, EndpointId &endpointId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
} // namespace PowerTopology
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,43 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/power-topology-server/power-topology-server.h>
/*
* Mock PowerTopology Delegate Implementation
* This file provides a mock implementation of the PowerTopology::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/power-topology-server/power-topology-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace PowerTopology {
class MockPowerTopologyDelegate : public Delegate {
public:
MockPowerTopologyDelegate() = default;
virtual ~MockPowerTopologyDelegate() = default;
// Delegate interface
CHIP_ERROR GetAvailableEndpointAtIndex(size_t index, EndpointId &endpointId) override;
CHIP_ERROR GetActiveEndpointAtIndex(size_t index, EndpointId &endpointId) override;
private:
static constexpr const char * LOG_TAG = "MockPowerTopologyDelegate";
};
} // namespace PowerTopology
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,179 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_push_av_stream_transport_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
Protocols::InteractionModel::Status MockPushAvStreamTransportDelegate::AllocatePushTransport(
const PushAvStreamTransport::Structs::TransportOptionsStruct::Type &transportOptions, const uint16_t connectionID,
FabricIndex accessingFabricIndex)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockPushAvStreamTransportDelegate::DeallocatePushTransport(const uint16_t connectionID)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockPushAvStreamTransportDelegate::ModifyPushTransport(
const uint16_t connectionID, const PushAvStreamTransport::TransportOptionsStorage transportOptions)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status
MockPushAvStreamTransportDelegate::SetTransportStatus(const std::vector<uint16_t> connectionIDList,
PushAvStreamTransport::TransportStatusEnum transportStatus)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockPushAvStreamTransportDelegate::ManuallyTriggerTransport(
const uint16_t connectionID, PushAvStreamTransport::TriggerActivationReasonEnum activationReason,
const Optional<PushAvStreamTransport::Structs::TransportMotionTriggerTimeControlStruct::Type> &timeControl)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
bool MockPushAvStreamTransportDelegate::ValidateStreamUsage(PushAvStreamTransport::StreamUsageEnum streamUsage)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockPushAvStreamTransportDelegate::ValidateSegmentDuration(uint16_t segmentDuration,
const Optional<DataModel::Nullable<uint16_t>> &videoStreamId)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
Protocols::InteractionModel::Status
MockPushAvStreamTransportDelegate::ValidateBandwidthLimit(PushAvStreamTransport::StreamUsageEnum streamUsage,
const Optional<DataModel::Nullable<uint16_t>> &videoStreamId,
const Optional<DataModel::Nullable<uint16_t>> &audioStreamId)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status
MockPushAvStreamTransportDelegate::SelectVideoStream(PushAvStreamTransport::StreamUsageEnum streamUsage, uint16_t &videoStreamId)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
videoStreamId = 0;
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status
MockPushAvStreamTransportDelegate::SelectAudioStream(PushAvStreamTransport::StreamUsageEnum streamUsage, uint16_t &audioStreamId)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
audioStreamId = 0;
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockPushAvStreamTransportDelegate::SetVideoStream(uint16_t videoStreamId)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockPushAvStreamTransportDelegate::SetAudioStream(uint16_t audioStreamId)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockPushAvStreamTransportDelegate::ValidateZoneId(uint16_t zoneId)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
bool MockPushAvStreamTransportDelegate::ValidateMotionZoneListSize(size_t zoneListSize)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
PushAvStreamTransport::PushAvStreamTransportStatusEnum
MockPushAvStreamTransportDelegate::GetTransportBusyStatus(const uint16_t connectionID)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return PushAvStreamTransport::PushAvStreamTransportStatusEnum::kIdle;
}
void MockPushAvStreamTransportDelegate::OnAttributeChanged(AttributeId attributeId)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
CHIP_ERROR MockPushAvStreamTransportDelegate::LoadCurrentConnections(
std::vector<PushAvStreamTransport::TransportConfigurationStorage> &currentConnections)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockPushAvStreamTransportDelegate::PersistentAttributesLoadedCallback()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
void MockPushAvStreamTransportDelegate::SetTLSCerts(Tls::CertificateTable::BufferedClientCert &clientCertEntry,
Tls::CertificateTable::BufferedRootCert &rootCertEntry)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
CHIP_ERROR MockPushAvStreamTransportDelegate::IsHardPrivacyModeActive(bool &isActive)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
isActive = false;
return CHIP_NO_ERROR;
}
CHIP_ERROR MockPushAvStreamTransportDelegate::IsSoftRecordingPrivacyModeActive(bool &isActive)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
isActive = false;
return CHIP_NO_ERROR;
}
CHIP_ERROR MockPushAvStreamTransportDelegate::IsSoftLivestreamPrivacyModeActive(bool &isActive)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
isActive = false;
return CHIP_NO_ERROR;
}
void MockPushAvStreamTransportDelegate::SetPushAvStreamTransportServer(PushAvStreamTransportServer * server)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
mServer = server;
return;
}
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,91 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/push-av-stream-transport-server/push-av-stream-transport-delegate.h>
#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace app {
namespace Clusters {
class MockPushAvStreamTransportDelegate : public PushAvStreamTransportDelegate {
public:
MockPushAvStreamTransportDelegate() = default;
virtual ~MockPushAvStreamTransportDelegate() = default;
Protocols::InteractionModel::Status
AllocatePushTransport(const PushAvStreamTransport::Structs::TransportOptionsStruct::Type &transportOptions,
const uint16_t connectionID, FabricIndex accessingFabricIndex) override;
Protocols::InteractionModel::Status DeallocatePushTransport(const uint16_t connectionID) override;
Protocols::InteractionModel::Status
ModifyPushTransport(const uint16_t connectionID,
const PushAvStreamTransport::TransportOptionsStorage transportOptions) override;
Protocols::InteractionModel::Status SetTransportStatus(const std::vector<uint16_t> connectionIDList,
PushAvStreamTransport::TransportStatusEnum transportStatus) override;
Protocols::InteractionModel::Status ManuallyTriggerTransport(
const uint16_t connectionID, PushAvStreamTransport::TriggerActivationReasonEnum activationReason,
const Optional<PushAvStreamTransport::Structs::TransportMotionTriggerTimeControlStruct::Type> &timeControl) override;
bool ValidateStreamUsage(PushAvStreamTransport::StreamUsageEnum streamUsage) override;
bool ValidateSegmentDuration(uint16_t segmentDuration,
const Optional<DataModel::Nullable<uint16_t>> &videoStreamId) override;
Protocols::InteractionModel::Status
ValidateBandwidthLimit(PushAvStreamTransport::StreamUsageEnum streamUsage,
const Optional<DataModel::Nullable<uint16_t>> &videoStreamId,
const Optional<DataModel::Nullable<uint16_t>> &audioStreamId) override;
Protocols::InteractionModel::Status SelectVideoStream(PushAvStreamTransport::StreamUsageEnum streamUsage,
uint16_t &videoStreamId) override;
Protocols::InteractionModel::Status SelectAudioStream(PushAvStreamTransport::StreamUsageEnum streamUsage,
uint16_t &audioStreamId) override;
Protocols::InteractionModel::Status SetVideoStream(uint16_t videoStreamId) override;
Protocols::InteractionModel::Status SetAudioStream(uint16_t audioStreamId) override;
Protocols::InteractionModel::Status ValidateZoneId(uint16_t zoneId) override;
bool ValidateMotionZoneListSize(size_t zoneListSize) override;
PushAvStreamTransport::PushAvStreamTransportStatusEnum GetTransportBusyStatus(const uint16_t connectionID) override;
void OnAttributeChanged(AttributeId attributeId) override;
CHIP_ERROR
LoadCurrentConnections(std::vector<PushAvStreamTransport::TransportConfigurationStorage> &currentConnections) override;
CHIP_ERROR PersistentAttributesLoadedCallback() override;
void SetTLSCerts(Tls::CertificateTable::BufferedClientCert &clientCertEntry,
Tls::CertificateTable::BufferedRootCert &rootCertEntry) override;
CHIP_ERROR IsHardPrivacyModeActive(bool &isActive) override;
CHIP_ERROR IsSoftRecordingPrivacyModeActive(bool &isActive) override;
CHIP_ERROR IsSoftLivestreamPrivacyModeActive(bool &isActive) override;
void SetPushAvStreamTransportServer(PushAvStreamTransportServer * server) override;
private:
static constexpr const char * LOG_TAG = "MockPushAvStreamTransportDelegate";
PushAvStreamTransportServer * mServer = nullptr;
};
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,49 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_resource_monitoring_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ResourceMonitoring {
CHIP_ERROR MockResourceMonitoringDelegate::Init()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
Protocols::InteractionModel::Status MockResourceMonitoringDelegate::OnResetCondition()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockResourceMonitoringDelegate::PreResetCondition()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockResourceMonitoringDelegate::PostResetCondition()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
} // namespace ResourceMonitoring
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,46 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/resource-monitoring-server/resource-monitoring-server.h>
/*
* Mock ResourceMonitoring Delegate Implementation
* This file provides a mock implementation of the ResourceMonitoring::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/include/resource-monitoring-delegates.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ResourceMonitoring {
class MockResourceMonitoringDelegate : public Delegate {
public:
MockResourceMonitoringDelegate() = default;
virtual ~MockResourceMonitoringDelegate() = default;
// Resource monitoring management
CHIP_ERROR Init() override;
Protocols::InteractionModel::Status OnResetCondition() override;
Protocols::InteractionModel::Status PreResetCondition() override;
Protocols::InteractionModel::Status PostResetCondition() override;
private:
static constexpr const char * LOG_TAG = "MockResourceMonitoringDelegate";
};
} // namespace ResourceMonitoring
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,51 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_service_area_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ServiceArea {
CHIP_ERROR MockServiceAreaDelegate::Init()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
bool MockServiceAreaDelegate::IsSetSelectedAreasAllowed(MutableCharSpan &statusText)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockServiceAreaDelegate::IsValidSelectAreasSet(const Span<const uint32_t> &selectedAreas, SelectAreasStatus &locationStatus,
MutableCharSpan &statusText)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
locationStatus = SelectAreasStatus::kSuccess;
return true;
}
bool MockServiceAreaDelegate::HandleSkipArea(uint32_t skippedArea, MutableCharSpan &skipStatusText)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
} // namespace ServiceArea
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,47 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/service-area-server/service-area-delegate.h>
/*
* Mock ServiceArea Delegate Implementation
* This file provides a mock implementation of the ServiceArea::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/service-area-server/service-area-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/rvc-app/rvc-common/include/rvc-service-area-delegate.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ServiceArea {
class MockServiceAreaDelegate : public Delegate {
public:
MockServiceAreaDelegate() : Delegate() {}
virtual ~MockServiceAreaDelegate() = default;
// Service area management
CHIP_ERROR Init() override;
bool IsSetSelectedAreasAllowed(MutableCharSpan &statusText) override;
bool IsValidSelectAreasSet(const Span<const uint32_t> &selectedAreas, SelectAreasStatus &locationStatus,
MutableCharSpan &statusText) override;
bool HandleSkipArea(uint32_t skippedArea, MutableCharSpan &skipStatusText) override;
private:
static constexpr const char * LOG_TAG = "MockServiceAreaDelegate";
};
} // namespace ServiceArea
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,52 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_target_navigator_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace TargetNavigator {
CHIP_ERROR MockTargetNavigatorDelegate::HandleGetTargetList(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeEmptyList();
}
uint8_t MockTargetNavigatorDelegate::HandleGetCurrentTarget()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
void MockTargetNavigatorDelegate::HandleNavigateTarget(CommandResponseHelper<Commands::NavigateTargetResponse::Type> &helper,
const uint64_t &target, const CharSpan &data)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
Commands::NavigateTargetResponse::Type response;
response.status = TargetNavigatorStatusEnum::kSuccess;
helper.Success(response);
}
uint16_t MockTargetNavigatorDelegate::GetClusterRevision(chip::EndpointId endpoint)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
} // namespace TargetNavigator
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,47 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/target-navigator-server/target-navigator-delegate.h>
/*
* Mock TargetNavigator Delegate Implementation
* This file provides a mock implementation of the TargetNavigator::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/target-navigator-server/target-navigator-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace TargetNavigator {
class MockTargetNavigatorDelegate : public Delegate {
public:
MockTargetNavigatorDelegate() = default;
CHIP_ERROR HandleGetTargetList(app::AttributeValueEncoder &aEncoder) override;
uint8_t HandleGetCurrentTarget() override;
void HandleNavigateTarget(CommandResponseHelper<Commands::NavigateTargetResponse::Type> &helper,
const uint64_t &target, const CharSpan &data) override;
uint16_t GetClusterRevision(chip::EndpointId endpoint) override;
private:
const char *LOG_TAG = "target_navigator";
};
} // namespace TargetNavigator
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,165 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_thermostat_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace Thermostat {
std::optional<System::Clock::Milliseconds16> MockThermostatDelegate::GetMaxAtomicWriteTimeout(chip::AttributeId attributeId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return std::nullopt;
}
CHIP_ERROR MockThermostatDelegate::GetPresetTypeAtIndex(size_t index, Structs::PresetTypeStruct::Type &presetType)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
uint8_t MockThermostatDelegate::GetNumberOfPresets()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockThermostatDelegate::GetPresetAtIndex(size_t index, PresetStructWithOwnedMembers &preset)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockThermostatDelegate::GetActivePresetHandle(DataModel::Nullable<MutableByteSpan> &activePresetHandle)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
activePresetHandle.SetNull();
return CHIP_NO_ERROR;
}
CHIP_ERROR MockThermostatDelegate::SetActivePresetHandle(const DataModel::Nullable<ByteSpan> &newActivePresetHandle)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
void MockThermostatDelegate::InitializePendingPresets()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
CHIP_ERROR MockThermostatDelegate::AppendToPendingPresetList(const PresetStructWithOwnedMembers &preset)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockThermostatDelegate::GetPendingPresetAtIndex(size_t index, PresetStructWithOwnedMembers &preset)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
CHIP_ERROR MockThermostatDelegate::CommitPendingPresets()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
void MockThermostatDelegate::ClearPendingPresetList()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
uint8_t MockThermostatDelegate::GetMaxThermostatSuggestions()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
uint8_t MockThermostatDelegate::GetNumberOfThermostatSuggestions()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
CHIP_ERROR MockThermostatDelegate::GetThermostatSuggestionAtIndex(
size_t index, ThermostatSuggestionStructWithOwnedMembers &thermostatSuggestion)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
void MockThermostatDelegate::GetCurrentThermostatSuggestion(
DataModel::Nullable<ThermostatSuggestionStructWithOwnedMembers> &currentThermostatSuggestion)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
currentThermostatSuggestion.SetNull();
return;
}
DataModel::Nullable<ThermostatSuggestionNotFollowingReasonBitmap>
MockThermostatDelegate::GetThermostatSuggestionNotFollowingReason()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<ThermostatSuggestionNotFollowingReasonBitmap>();
}
CHIP_ERROR
MockThermostatDelegate::AppendToThermostatSuggestionsList(const Structs::ThermostatSuggestionStruct::Type &thermostatSuggestion)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockThermostatDelegate::RemoveFromThermostatSuggestionsList(size_t indexToRemove)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockThermostatDelegate::GetUniqueID(uint8_t &uniqueID)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
uniqueID = 0;
return CHIP_NO_ERROR;
}
CHIP_ERROR MockThermostatDelegate::ReEvaluateCurrentSuggestion()
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockThermostatDelegate::GetScheduleTypeAtIndex(size_t index, Structs::ScheduleTypeStruct::Type &scheduleType)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
} // namespace Thermostat
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,64 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/thermostat-server/thermostat-delegate.h>
/*
* Mock Thermostat Delegate Implementation
* This file provides a mock implementation of the Thermostat::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/thermostat-server/thermostat-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/thermostat/thermostat-common/include/thermostat-delegate-impl.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/thermostat/thermostat-common/src/thermostat-delegate-impl.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace Thermostat {
class MockThermostatDelegate : public Delegate {
public:
MockThermostatDelegate() = default;
std::optional<System::Clock::Milliseconds16> GetMaxAtomicWriteTimeout(chip::AttributeId attributeId) override;
CHIP_ERROR GetPresetTypeAtIndex(size_t index, Structs::PresetTypeStruct::Type &presetType) override;
uint8_t GetNumberOfPresets() override;
CHIP_ERROR GetPresetAtIndex(size_t index, PresetStructWithOwnedMembers &preset) override;
CHIP_ERROR GetActivePresetHandle(DataModel::Nullable<MutableByteSpan> &activePresetHandle) override;
CHIP_ERROR SetActivePresetHandle(const DataModel::Nullable<ByteSpan> &newActivePresetHandle) override;
void InitializePendingPresets() override;
CHIP_ERROR AppendToPendingPresetList(const PresetStructWithOwnedMembers &preset) override;
CHIP_ERROR GetPendingPresetAtIndex(size_t index, PresetStructWithOwnedMembers &preset) override;
CHIP_ERROR CommitPendingPresets() override;
void ClearPendingPresetList() override;
uint8_t GetMaxThermostatSuggestions() override;
uint8_t GetNumberOfThermostatSuggestions() override;
CHIP_ERROR GetThermostatSuggestionAtIndex(size_t index,
ThermostatSuggestionStructWithOwnedMembers &thermostatSuggestion) override;
void GetCurrentThermostatSuggestion(
DataModel::Nullable<ThermostatSuggestionStructWithOwnedMembers> &currentThermostatSuggestion) override;
DataModel::Nullable<ThermostatSuggestionNotFollowingReasonBitmap> GetThermostatSuggestionNotFollowingReason() override;
CHIP_ERROR
AppendToThermostatSuggestionsList(const Structs::ThermostatSuggestionStruct::Type &thermostatSuggestion) override;
CHIP_ERROR RemoveFromThermostatSuggestionsList(size_t indexToRemove) override;
CHIP_ERROR GetUniqueID(uint8_t &uniqueID) override;
CHIP_ERROR ReEvaluateCurrentSuggestion() override;
CHIP_ERROR GetScheduleTypeAtIndex(size_t index, Structs::ScheduleTypeStruct::Type &scheduleType) override;
private:
const char *LOG_TAG = "thermostat";
};
} // namespace Thermostat
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,100 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_thread_border_router_management_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ThreadBorderRouterManagement {
CHIP_ERROR MockThreadBorderRouterManagementDelegate::Init(AttributeChangeCallback * attributeChangeCallback)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
bool MockThreadBorderRouterManagementDelegate::GetPanChangeSupported()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return false;
}
void MockThreadBorderRouterManagementDelegate::GetBorderRouterName(MutableCharSpan &borderRouterName)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
borderRouterName.reduce_size(0);
return;
}
CHIP_ERROR MockThreadBorderRouterManagementDelegate::GetBorderAgentId(MutableByteSpan &borderAgentId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_IMPLEMENTED;
}
uint16_t MockThreadBorderRouterManagementDelegate::GetThreadVersion()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
bool MockThreadBorderRouterManagementDelegate::GetInterfaceEnabled()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return false;
}
CHIP_ERROR MockThreadBorderRouterManagementDelegate::GetDataset(Thread::OperationalDataset &dataset, DatasetType type)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
void MockThreadBorderRouterManagementDelegate::SetActiveDataset(const Thread::OperationalDataset &activeDataset, uint32_t sequenceNum,
ActivateDatasetCallback * callback)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
CHIP_ERROR MockThreadBorderRouterManagementDelegate::CommitActiveDataset()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockThreadBorderRouterManagementDelegate::RevertActiveDataset()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockThreadBorderRouterManagementDelegate::SetPendingDataset(const Thread::OperationalDataset &pendingDataset)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace ThreadBorderRouterManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,53 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/thread-border-router-management-server/thread-br-delegate.h>
#include <protocols/interaction_model/StatusCode.h>
/*
* Mock ThreadBorderRouterManagement Delegate Implementation
* This file provides a mock implementation of the ThreadBorderRouterManagement::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/thread-border-router-management-server/thread-br-delegate.h
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ThreadBorderRouterManagement {
class MockThreadBorderRouterManagementDelegate : public Delegate {
public:
MockThreadBorderRouterManagementDelegate() : Delegate() {}
virtual ~MockThreadBorderRouterManagementDelegate() = default;
// Thread Border Router management
CHIP_ERROR Init(AttributeChangeCallback * attributeChangeCallback) override;
bool GetPanChangeSupported() override;
void GetBorderRouterName(MutableCharSpan &borderRouterName) override;
CHIP_ERROR GetBorderAgentId(MutableByteSpan &borderAgentId) override;
uint16_t GetThreadVersion() override;
bool GetInterfaceEnabled() override;
CHIP_ERROR GetDataset(Thread::OperationalDataset &dataset, DatasetType type) override;
void SetActiveDataset(const Thread::OperationalDataset &activeDataset, uint32_t sequenceNum,
ActivateDatasetCallback * callback) override;
CHIP_ERROR CommitActiveDataset() override;
CHIP_ERROR RevertActiveDataset() override;
CHIP_ERROR SetPendingDataset(const Thread::OperationalDataset &pendingDataset) override;
private:
static constexpr const char * LOG_TAG = "MockThreadBRMgmtDelegate";
};
} // namespace ThreadBorderRouterManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,85 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_time_synchronization_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace TimeSynchronization {
void MockTimeSynchronizationDelegate::TimeZoneListChanged(const Span<TimeSyncDataProvider::TimeZoneStore> timeZoneList)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
bool MockTimeSynchronizationDelegate::HandleUpdateDSTOffset(const CharSpan name)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return false;
}
bool MockTimeSynchronizationDelegate::IsNTPAddressValid(const CharSpan ntp)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
bool MockTimeSynchronizationDelegate::IsNTPAddressDomain(const CharSpan ntp)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return true;
}
CHIP_ERROR MockTimeSynchronizationDelegate::UpdateTimeFromPlatformSource(chip::Callback::Callback<OnTimeSyncCompletion> * callback)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_IMPLEMENTED;
}
CHIP_ERROR MockTimeSynchronizationDelegate::UpdateTimeUsingNTPFallback(const CharSpan &fallbackNTP,
chip::Callback::Callback<OnFallbackNTPCompletion> * callback)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_IMPLEMENTED;
}
void MockTimeSynchronizationDelegate::UTCTimeAvailabilityChanged(uint64_t time)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockTimeSynchronizationDelegate::TrustedTimeSourceAvailabilityChanged(bool available, GranularityEnum granularity)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
void MockTimeSynchronizationDelegate::NotifyTimeFailure()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
} // namespace TimeSynchronization
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,52 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/time-synchronization-server/time-synchronization-delegate.h>
/*
* Mock TimeSynchronization Delegate Implementation
* This file provides a mock implementation of the TimeSynchronization::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/time-synchronization-server/DefaultTimeSyncDelegate.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/time-synchronization-server/DefaultTimeSyncDelegate.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace TimeSynchronization {
class MockTimeSynchronizationDelegate : public Delegate {
public:
MockTimeSynchronizationDelegate() : Delegate() {}
virtual ~MockTimeSynchronizationDelegate() = default;
// Time synchronization management
void TimeZoneListChanged(const Span<TimeSyncDataProvider::TimeZoneStore> timeZoneList) override;
bool HandleUpdateDSTOffset(const CharSpan name) override;
bool IsNTPAddressValid(const CharSpan ntp) override;
bool IsNTPAddressDomain(const CharSpan ntp) override;
CHIP_ERROR UpdateTimeFromPlatformSource(chip::Callback::Callback<OnTimeSyncCompletion> * callback) override;
CHIP_ERROR UpdateTimeUsingNTPFallback(const CharSpan &fallbackNTP,
chip::Callback::Callback<OnFallbackNTPCompletion> * callback) override;
void UTCTimeAvailabilityChanged(uint64_t time) override;
void TrustedTimeSourceAvailabilityChanged(bool available, GranularityEnum granularity) override;
void NotifyTimeFailure() override;
private:
static constexpr const char * LOG_TAG = "MockTimeSynchronizationDelegate";
};
} // namespace TimeSynchronization
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,133 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_tls_certificate_management_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
Protocols::InteractionModel::Status
MockTlsCertificateManagementDelegate::ProvisionRootCert(EndpointId matterEndpoint, FabricIndex fabric,
const ProvisionRootCertificateType &provisionReq, Tls::TLSCAID &outCaid)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
outCaid = 0;
return Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::LoadedRootCerts(EndpointId matterEndpoint, FabricIndex fabric,
LoadedRootCertificateCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::RootCertsForFabric(EndpointId matterEndpoint, FabricIndex fabric,
RootCertificateListCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::FindRootCert(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCAID id,
LoadedRootCertificateCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::LookupRootCertByFingerprint(EndpointId matterEndpoint, FabricIndex fabric,
const ByteSpan &fingerprint,
LoadedRootCertificateCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::LookupRootCert(EndpointId matterEndpoint, FabricIndex fabric,
const ByteSpan &cert,
LoadedRootCertificateCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
Protocols::InteractionModel::Status MockTlsCertificateManagementDelegate::RemoveRootCert(EndpointId matterEndpoint,
FabricIndex fabric, Tls::TLSCAID id)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockTlsCertificateManagementDelegate::GenerateClientCsr(EndpointId matterEndpoint,
FabricIndex fabric,
const ClientCsrType &request,
GeneratedCsrCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Failure;
}
Protocols::InteractionModel::Status
MockTlsCertificateManagementDelegate::ProvisionClientCert(EndpointId matterEndpoint, FabricIndex fabric,
const ProvisionClientCertificateType &provisionReq)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::LoadedClientCerts(EndpointId matterEndpoint, FabricIndex fabric,
LoadedClientCertificateCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::ClientCertsForFabric(EndpointId matterEndpoint, FabricIndex fabric,
ClientCertificateListCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::FindClientCert(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCCDID id,
LoadedClientCertificateCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::LookupClientCertByFingerprint(EndpointId matterEndpoint, FabricIndex fabric,
const ByteSpan &fingerprint,
LoadedClientCertificateCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
CHIP_ERROR MockTlsCertificateManagementDelegate::LookupClientCert(EndpointId matterEndpoint, FabricIndex fabric,
const ByteSpan &certificate,
LoadedClientCertificateCallback loadedCallback) const
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
Protocols::InteractionModel::Status MockTlsCertificateManagementDelegate::RemoveClientCert(EndpointId matterEndpoint,
FabricIndex fabric, Tls::TLSCCDID id)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,74 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/tls-certificate-management-server/TlsCertificateManagementCluster.h>
#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace app {
namespace Clusters {
class MockTlsCertificateManagementDelegate : public TlsCertificateManagementDelegate {
public:
MockTlsCertificateManagementDelegate() = default;
virtual ~MockTlsCertificateManagementDelegate() = default;
Protocols::InteractionModel::Status ProvisionRootCert(EndpointId matterEndpoint, FabricIndex fabric,
const ProvisionRootCertificateType &provisionReq,
Tls::TLSCAID &outCaid) override;
CHIP_ERROR LoadedRootCerts(EndpointId matterEndpoint, FabricIndex fabric,
LoadedRootCertificateCallback loadedCallback) const override;
CHIP_ERROR RootCertsForFabric(EndpointId matterEndpoint, FabricIndex fabric,
RootCertificateListCallback loadedCallback) const override;
CHIP_ERROR FindRootCert(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCAID id,
LoadedRootCertificateCallback loadedCallback) const override;
CHIP_ERROR LookupRootCertByFingerprint(EndpointId matterEndpoint, FabricIndex fabric, const ByteSpan &fingerprint,
LoadedRootCertificateCallback loadedCallback) const override;
CHIP_ERROR LookupRootCert(EndpointId matterEndpoint, FabricIndex fabric, const ByteSpan &cert,
LoadedRootCertificateCallback loadedCallback) const override;
Protocols::InteractionModel::Status RemoveRootCert(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCAID id) override;
Protocols::InteractionModel::Status GenerateClientCsr(EndpointId matterEndpoint, FabricIndex fabric,
const ClientCsrType &request,
GeneratedCsrCallback loadedCallback) const override;
Protocols::InteractionModel::Status ProvisionClientCert(EndpointId matterEndpoint, FabricIndex fabric,
const ProvisionClientCertificateType &provisionReq) override;
CHIP_ERROR LoadedClientCerts(EndpointId matterEndpoint, FabricIndex fabric,
LoadedClientCertificateCallback loadedCallback) const override;
CHIP_ERROR ClientCertsForFabric(EndpointId matterEndpoint, FabricIndex fabric,
ClientCertificateListCallback loadedCallback) const override;
CHIP_ERROR FindClientCert(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCCDID id,
LoadedClientCertificateCallback loadedCallback) const override;
CHIP_ERROR LookupClientCertByFingerprint(EndpointId matterEndpoint, FabricIndex fabric, const ByteSpan &fingerprint,
LoadedClientCertificateCallback loadedCallback) const override;
CHIP_ERROR LookupClientCert(EndpointId matterEndpoint, FabricIndex fabric, const ByteSpan &certificate,
LoadedClientCertificateCallback loadedCallback) const override;
Protocols::InteractionModel::Status RemoveClientCert(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCCDID id) override;
private:
static constexpr const char * LOG_TAG = "MockTlsCertificateManagementDelegate";
};
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,81 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_tls_client_management_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
CHIP_ERROR MockTlsClientManagementDelegate::Init(PersistentStorageDelegate &storage)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockTlsClientManagementDelegate::ForEachEndpoint(EndpointId matterEndpoint, FabricIndex fabric,
LoadedEndpointCallback callback)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockTlsClientManagementDelegate::FindProvisionedEndpointByID(EndpointId matterEndpoint, FabricIndex fabric,
uint16_t endpointID, LoadedEndpointCallback callback)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_ERROR_NOT_FOUND;
}
Protocols::InteractionModel::ClusterStatusCode MockTlsClientManagementDelegate::ProvisionEndpoint(
EndpointId matterEndpoint, FabricIndex fabric,
const TlsClientManagement::Commands::ProvisionEndpoint::DecodableType &provisionReq, uint16_t &endpointID)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
endpointID = 0;
return Protocols::InteractionModel::ClusterStatusCode(Protocols::InteractionModel::Status::Success);
}
Protocols::InteractionModel::Status MockTlsClientManagementDelegate::RemoveProvisionedEndpointByID(EndpointId matterEndpoint,
FabricIndex fabric,
uint16_t endpointID)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
void MockTlsClientManagementDelegate::RemoveFabric(FabricIndex fabricIndex)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
CHIP_ERROR MockTlsClientManagementDelegate::MutateEndpointReferenceCount(EndpointId matterEndpoint, FabricIndex fabric,
uint16_t endpointID, int8_t delta)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockTlsClientManagementDelegate::RootCertCanBeRemoved(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCAID id)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockTlsClientManagementDelegate::ClientCertCanBeRemoved(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCCDID id)
{
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,54 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/tls-client-management-server/TlsClientManagementCluster.h>
#include <protocols/interaction_model/StatusCode.h>
namespace chip {
namespace app {
namespace Clusters {
class MockTlsClientManagementDelegate : public TlsClientManagementDelegate {
public:
MockTlsClientManagementDelegate() = default;
virtual ~MockTlsClientManagementDelegate() = default;
CHIP_ERROR Init(PersistentStorageDelegate &storage) override;
CHIP_ERROR ForEachEndpoint(EndpointId matterEndpoint, FabricIndex fabric, LoadedEndpointCallback callback) override;
CHIP_ERROR FindProvisionedEndpointByID(EndpointId matterEndpoint, FabricIndex fabric, uint16_t endpointID,
LoadedEndpointCallback callback) override;
Protocols::InteractionModel::ClusterStatusCode
ProvisionEndpoint(EndpointId matterEndpoint, FabricIndex fabric,
const TlsClientManagement::Commands::ProvisionEndpoint::DecodableType &provisionReq,
uint16_t &endpointID) override;
Protocols::InteractionModel::Status RemoveProvisionedEndpointByID(EndpointId matterEndpoint, FabricIndex fabric,
uint16_t endpointID) override;
void RemoveFabric(FabricIndex fabricIndex) override;
CHIP_ERROR MutateEndpointReferenceCount(EndpointId matterEndpoint, FabricIndex fabric, uint16_t endpointID,
int8_t delta) override;
// CertificateDependencyChecker interface
CHIP_ERROR RootCertCanBeRemoved(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCAID id) override;
CHIP_ERROR ClientCertCanBeRemoved(EndpointId matterEndpoint, FabricIndex fabric, Tls::TLSCCDID id) override;
private:
static constexpr const char * LOG_TAG = "MockTlsClientManagementDelegate";
};
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,42 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_valve_configuration_and_control_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace ValveConfigurationAndControl {
DataModel::Nullable<chip::Percent> MockValveConfigurationAndControlDelegate::HandleOpenValve(DataModel::Nullable<chip::Percent> level)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return DataModel::Nullable<chip::Percent>();
}
CHIP_ERROR MockValveConfigurationAndControlDelegate::HandleCloseValve()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
void MockValveConfigurationAndControlDelegate::HandleRemainingDurationTick(uint32_t duration)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return;
}
} // namespace ValveConfigurationAndControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,45 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-delegate.h>
/*
* Mock ValveConfigurationAndControl Delegate Implementation
* This file provides a mock implementation of the ValveConfigurationAndControl::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/linux/ValveControlDelegate.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/all-clusters-app/linux/ValveControlDelegate.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace ValveConfigurationAndControl {
class MockValveConfigurationAndControlDelegate : public Delegate {
public:
MockValveConfigurationAndControlDelegate() : Delegate() {}
virtual ~MockValveConfigurationAndControlDelegate() = default;
// Valve configuration and control handlers
DataModel::Nullable<chip::Percent> HandleOpenValve(DataModel::Nullable<chip::Percent> level) override;
CHIP_ERROR HandleCloseValve() override;
void HandleRemainingDurationTick(uint32_t duration) override;
private:
static constexpr const char * LOG_TAG = "MockValveConfigurationAndControlDelegate";
};
} // namespace ValveConfigurationAndControl
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,28 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_wake_on_lan_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace WakeOnLan {
CHIP_ERROR MockWakeOnLanDelegate::HandleGetMacAddress(app::AttributeValueEncoder &aEncoder)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return aEncoder.EncodeNull();
}
} // namespace WakeOnLan
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,41 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/wake-on-lan-server/wake-on-lan-delegate.h>
/*
* Mock WakeOnLan Delegate Implementation
* This file provides a mock implementation of the WakeOnLan::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/wake-on-lan-server/wake-on-lan-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/wake-on-lan/WakeOnLanManager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/tv-app/tv-common/clusters/wake-on-lan/WakeOnLanManager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace WakeOnLan {
class MockWakeOnLanDelegate : public Delegate {
public:
MockWakeOnLanDelegate() = default;
CHIP_ERROR HandleGetMacAddress(app::AttributeValueEncoder &aEncoder) override;
private:
const char *LOG_TAG = "wake_on_lan";
};
} // namespace WakeOnLan
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,79 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_water_heater_management_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace WaterHeaterManagement {
Protocols::InteractionModel::Status MockWaterHeaterManagementDelegate::HandleBoost(uint32_t duration, Optional<bool> oneShot,
Optional<bool> emergencyBoost, Optional<int16_t> temporarySetpoint,
Optional<Percent> targetPercentage, Optional<Percent> targetReheat)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
Protocols::InteractionModel::Status MockWaterHeaterManagementDelegate::HandleCancelBoost()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Protocols::InteractionModel::Status::Success;
}
BitMask<WaterHeaterHeatSourceBitmap> MockWaterHeaterManagementDelegate::GetHeaterTypes()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return BitMask<WaterHeaterHeatSourceBitmap>();
}
BitMask<WaterHeaterHeatSourceBitmap> MockWaterHeaterManagementDelegate::GetHeatDemand()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return BitMask<WaterHeaterHeatSourceBitmap>();
}
uint16_t MockWaterHeaterManagementDelegate::GetTankVolume()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return 0;
}
Energy_mWh MockWaterHeaterManagementDelegate::GetEstimatedHeatRequired()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Energy_mWh(0);
}
Percent MockWaterHeaterManagementDelegate::GetTankPercentage()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return Percent(0);
}
BoostStateEnum MockWaterHeaterManagementDelegate::GetBoostState()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return BoostStateEnum::kUnknownEnumValue;
}
} // namespace WaterHeaterManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,55 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/water-heater-management-server/water-heater-management-server.h>
/*
* Mock WaterHeaterManagement Delegate Implementation
* This file provides a mock implementation of the WaterHeaterManagement::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/water-heater-management-server/water-heater-management-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/water-heater/include/WhmDelegate.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/energy-management-app/energy-management-common/water-heater/src/WhmDelegateImpl.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace WaterHeaterManagement {
class MockWaterHeaterManagementDelegate : public Delegate {
public:
MockWaterHeaterManagementDelegate() = default;
virtual ~MockWaterHeaterManagementDelegate() = default;
// Delegate interface
Protocols::InteractionModel::Status HandleBoost(uint32_t duration, Optional<bool> oneShot,
Optional<bool> emergencyBoost, Optional<int16_t> temporarySetpoint,
Optional<Percent> targetPercentage, Optional<Percent> targetReheat) override;
Protocols::InteractionModel::Status HandleCancelBoost() override;
// Get attribute methods
BitMask<WaterHeaterHeatSourceBitmap> GetHeaterTypes() override;
BitMask<WaterHeaterHeatSourceBitmap> GetHeatDemand() override;
uint16_t GetTankVolume() override;
Energy_mWh GetEstimatedHeatRequired() override;
Percent GetTankPercentage() override;
BoostStateEnum GetBoostState() override;
private:
static constexpr const char * LOG_TAG = "MockWaterHeaterManagementDelegate";
};
} // namespace WaterHeaterManagement
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,69 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_webrtc_transport_provider_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace WebRTCTransportProvider {
CHIP_ERROR MockWebRTCTransportProviderDelegate::HandleSolicitOffer(const OfferRequestArgs &args, WebRTCSessionStruct &outSession,
bool &outDeferredOffer)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
outDeferredOffer = false;
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWebRTCTransportProviderDelegate::HandleProvideOffer(const ProvideOfferRequestArgs &args, WebRTCSessionStruct &outSession)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWebRTCTransportProviderDelegate::HandleProvideAnswer(uint16_t sessionId, const std::string &sdpAnswer)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWebRTCTransportProviderDelegate::HandleProvideICECandidates(uint16_t sessionId, const std::vector<ICECandidateStruct> &candidates)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWebRTCTransportProviderDelegate::HandleEndSession(uint16_t sessionId, WebRTCEndReasonEnum reasonCode,
DataModel::Nullable<uint16_t> videoStreamID,
DataModel::Nullable<uint16_t> audioStreamID)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWebRTCTransportProviderDelegate::ValidateStreamUsage(StreamUsageEnum streamUsage,
Optional<DataModel::Nullable<uint16_t>> &videoStreamId,
Optional<DataModel::Nullable<uint16_t>> &audioStreamId)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace WebRTCTransportProvider
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,58 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/webrtc-transport-provider-server/WebRTCTransportProviderCluster.h>
/*
* Mock WebRTCTransportProvider Delegate Implementation
* This file provides a mock implementation of the WebRTCTransportProvider::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/webrtc-transport-provider-server/webrtc-transport-provider-server.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/camera-app/linux/include/clusters/webrtc_provider/webrtc-provider-manager.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/camera-app/linux/src/clusters/webrtc_provider/webrtc-provider-manager.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace WebRTCTransportProvider {
class MockWebRTCTransportProviderDelegate : public Delegate {
public:
MockWebRTCTransportProviderDelegate() = default;
virtual ~MockWebRTCTransportProviderDelegate() = default;
// Delegate interface
CHIP_ERROR HandleSolicitOffer(const OfferRequestArgs &args, WebRTCSessionStruct &outSession,
bool &outDeferredOffer) override;
CHIP_ERROR HandleProvideOffer(const ProvideOfferRequestArgs &args, WebRTCSessionStruct &outSession) override;
CHIP_ERROR HandleProvideAnswer(uint16_t sessionId, const std::string &sdpAnswer) override;
CHIP_ERROR HandleProvideICECandidates(uint16_t sessionId, const std::vector<ICECandidateStruct> &candidates) override;
CHIP_ERROR HandleEndSession(uint16_t sessionId, WebRTCEndReasonEnum reasonCode,
DataModel::Nullable<uint16_t> videoStreamID,
DataModel::Nullable<uint16_t> audioStreamID) override;
CHIP_ERROR ValidateStreamUsage(StreamUsageEnum streamUsage,
Optional<DataModel::Nullable<uint16_t>> &videoStreamId,
Optional<DataModel::Nullable<uint16_t>> &audioStreamId) override;
private:
static constexpr const char * LOG_TAG = "MockWebRTCTransportProviderDelegate";
};
} // namespace WebRTCTransportProvider
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,50 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_webrtc_transport_requestor_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace WebRTCTransportRequestor {
CHIP_ERROR MockWebRTCTransportRequestorDelegate::HandleOffer(const WebRTCSessionStruct &session, const OfferArgs &args)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWebRTCTransportRequestorDelegate::HandleAnswer(const WebRTCSessionStruct &session, const std::string &sdpAnswer)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWebRTCTransportRequestorDelegate::HandleICECandidates(const WebRTCSessionStruct &session,
const std::vector<ICECandidateStruct> &candidates)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWebRTCTransportRequestorDelegate::HandleEnd(const WebRTCSessionStruct &session, WebRTCEndReasonEnum reasonCode)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace WebRTCTransportRequestor
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,46 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/webrtc-transport-requestor-server/WebRTCTransportRequestorCluster.h>
#include <protocols/interaction_model/StatusCode.h>
/*
* Mock WebRTCTransportRequestor Delegate Implementation
* This file provides a mock implementation of the WebRTCTransportRequestor::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/webrtc-transport-requestor-server/webrtc-transport-requestor-cluster.h
*/
namespace chip {
namespace app {
namespace Clusters {
namespace WebRTCTransportRequestor {
class MockWebRTCTransportRequestorDelegate : public Delegate {
public:
MockWebRTCTransportRequestorDelegate() : Delegate() {}
virtual ~MockWebRTCTransportRequestorDelegate() = default;
// WebRTC transport requestor handlers
CHIP_ERROR HandleOffer(const WebRTCSessionStruct &session, const OfferArgs &args) override;
CHIP_ERROR HandleAnswer(const WebRTCSessionStruct &session, const std::string &sdpAnswer) override;
CHIP_ERROR HandleICECandidates(const WebRTCSessionStruct &session,
const std::vector<ICECandidateStruct> &candidates) override;
CHIP_ERROR HandleEnd(const WebRTCSessionStruct &session, WebRTCEndReasonEnum reasonCode) override;
private:
static constexpr const char * LOG_TAG = "MockWebRTCTransportRequestorDelegate";
};
} // namespace WebRTCTransportRequestor
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,35 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "esp_log.h"
#include "mock_window_covering_delegate.h"
namespace chip {
namespace app {
namespace Clusters {
namespace WindowCovering {
CHIP_ERROR MockWindowCoveringDelegate::HandleMovement(WindowCoveringType type)
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
CHIP_ERROR MockWindowCoveringDelegate::HandleStopMotion()
{
// Implement your own logic here.
ESP_LOGE(LOG_TAG, "%s is not implemented", __func__);
return CHIP_NO_ERROR;
}
} // namespace WindowCovering
} // namespace Clusters
} // namespace app
} // namespace chip
@@ -0,0 +1,42 @@
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include <app/clusters/window-covering-server/window-covering-delegate.h>
/*
* Mock WindowCovering Delegate Implementation
* This file provides a mock implementation of the WindowCovering::Delegate interface
* that returns success for all methods.
* For more details, take a look at the delegate interface in the Matter SDK.
* 1. Delegate Interface: https://github.com/project-chip/connectedhomeip/blob/d144bbb/src/app/clusters/window-covering-server/window-covering-delegate.h
* 2. Delegate Implementation: https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/chef/common/clusters/window-covering/chef-window-covering.h and
* https://github.com/project-chip/connectedhomeip/blob/d144bbb/examples/chef/common/clusters/window-covering/chef-window-covering.cpp
*/
namespace chip {
namespace app {
namespace Clusters {
namespace WindowCovering {
class MockWindowCoveringDelegate : public Delegate {
public:
MockWindowCoveringDelegate() = default;
CHIP_ERROR HandleMovement(WindowCoveringType type) override;
CHIP_ERROR HandleStopMotion() override;
private:
const char *LOG_TAG = "window_covering";
};
} // namespace WindowCovering
} // namespace Clusters
} // namespace app
} // namespace chip

Some files were not shown because too many files have changed in this diff Show More