Files
cariflex/tools/EVerest-main/modules/API/RpcApi/tests/helpers/RequestHandlerDummy.cpp
Eric F d398a6ced2 Add extracted tools: CitrineOS, OpenOCPP, ShapeShifter
- CitrineOS core extracted (CSMS OCPP 2.0.1)
- OpenOCPP extracted (firmware OCPP 1.6J/2.0.1)
- ShapeShifter library installed (pip install -e)
- ShapeShifter specification extracted
- EVerest extracted

TODO updated with progress
2026-06-08 00:38:27 -04:00

67 lines
3.2 KiB
C++

// SPDX-License-Identifier: Apache-2.0
// Copyright chargebyte GmbH and Contributors to EVerest
#include "RequestHandlerDummy.hpp"
using namespace types::json_rpc_api;
RequestHandlerDummy::RequestHandlerDummy(data::DataStoreCharger& dataobj) : data_store(dataobj) {
}
types::json_rpc_api::ErrorResObj RequestHandlerDummy::set_charging_allowed(const int32_t evse_index,
bool charging_allowed) {
ErrorResObj res{};
auto evse_store = data_store.get_evse_store(evse_index);
evse_store->evsestatus.set_charging_allowed(charging_allowed);
return res;
}
types::json_rpc_api::ErrorResObj RequestHandlerDummy::set_ac_charging(const int32_t evse_index, bool charging_allowed,
bool max_current,
std::optional<int> phase_count) {
types::json_rpc_api::ErrorResObj res{types::json_rpc_api::ResponseErrorEnum::NoError};
return res;
}
types::json_rpc_api::ErrorResObj RequestHandlerDummy::set_ac_charging_current(const int32_t evse_index,
float max_current) {
ErrorResObj res{};
auto evse_store = data_store.get_evse_store(evse_index);
auto evse_state = evse_store->evsestatus.get_state();
// Skipping applying limits if charging is not allowed.
// In this case, the zero limit is already applied to prevent charging. This value should not be overridden.
if (evse_store->evsestatus.get_data()->charging_allowed == false) {
res.error = ResponseErrorEnum::NoError;
return res;
}
// Wait until the limits are applied or timeout occurs
if (evse_store->evsestatus.wait_until_current_limit_applied(max_current, std::chrono::milliseconds(100))) {
res.error = ResponseErrorEnum::NoError;
} else {
res.error = ResponseErrorEnum::ErrorValuesNotApplied;
}
return res;
}
types::json_rpc_api::ErrorResObj RequestHandlerDummy::set_ac_charging_phase_count(const int32_t evse_index,
int phase_count) {
types::json_rpc_api::ErrorResObj res{types::json_rpc_api::ResponseErrorEnum::NoError};
return res;
}
types::json_rpc_api::ErrorResObj RequestHandlerDummy::set_dc_charging(const int32_t evse_index, bool charging_allowed,
float max_power) {
types::json_rpc_api::ErrorResObj res{types::json_rpc_api::ResponseErrorEnum::NoError};
return res;
}
types::json_rpc_api::ErrorResObj RequestHandlerDummy::set_dc_charging_power(const int32_t evse_index, float max_power) {
types::json_rpc_api::ErrorResObj res{types::json_rpc_api::ResponseErrorEnum::NoError};
return res;
}
types::json_rpc_api::ErrorResObj RequestHandlerDummy::enable_connector(const int32_t evse_index, int connector_id,
bool enable, int priority) {
types::json_rpc_api::ErrorResObj res{types::json_rpc_api::ResponseErrorEnum::NoError};
return res;
}