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
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright chargebyte GmbH and Contributors to EVerest
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "ChargePoint.hpp"
|
||||
|
||||
namespace methods {
|
||||
|
||||
RPCDataTypes::ChargePointGetEVSEInfosResObj ChargePoint::getEVSEInfos() {
|
||||
RPCDataTypes::ChargePointGetEVSEInfosResObj res{};
|
||||
// Iterate over all EVSEs and add the EVSEInfo objects to the response
|
||||
for (const auto& evse : m_dataobj.evses) {
|
||||
if (const auto _data = evse->evseinfo.get_data(); _data.has_value()) {
|
||||
res.infos.push_back(_data.value());
|
||||
}
|
||||
}
|
||||
|
||||
// Error handling
|
||||
if (res.infos.empty()) {
|
||||
res.error = RPCDataTypes::ResponseErrorEnum::ErrorNoDataAvailable;
|
||||
} else {
|
||||
res.error = RPCDataTypes::ResponseErrorEnum::NoError;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
RPCDataTypes::ChargePointGetActiveErrorsResObj ChargePoint::getActiveErrors() {
|
||||
RPCDataTypes::ChargePointGetActiveErrorsResObj res{};
|
||||
|
||||
res.active_errors = m_dataobj.chargererrors.get_data().value_or(std::vector<RPCDataTypes::ErrorObj>{});
|
||||
res.error = RPCDataTypes::ResponseErrorEnum::NoError;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace methods
|
||||
Reference in New Issue
Block a user