From 15db6f10ba69c0668b3c6fbd0840edbb321cecdc Mon Sep 17 00:00:00 2001 From: Matthias Suess Date: Thu, 28 Nov 2024 11:17:35 +0100 Subject: [PATCH] Modification related to clang format Signed-off-by: Matthias Suess --- lib/ocpp/v16/charge_point_impl.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/ocpp/v16/charge_point_impl.cpp b/lib/ocpp/v16/charge_point_impl.cpp index 3033295e9..b869eac0e 100644 --- a/lib/ocpp/v16/charge_point_impl.cpp +++ b/lib/ocpp/v16/charge_point_impl.cpp @@ -1926,9 +1926,10 @@ void ChargePointImpl::handleRemoteStartTransactionRequest(ocpp::Call referenced_connectors; if (call.msg.connectorId) { - if (call.msg.connectorId.value() <= 0 or call.msg.connectorId.value() > this->configuration->getNumberOfConnectors()) { + if (call.msg.connectorId.value() <= 0 or + call.msg.connectorId.value() > this->configuration->getNumberOfConnectors()) { EVLOG_warning << "Received RemoteStartTransactionRequest with connector id <= 0 or > " - << this->configuration->getNumberOfConnectors(); + << this->configuration->getNumberOfConnectors(); response.status = RemoteStartStopStatus::Rejected; ocpp::CallResult call_result(response, call.uniqueId); this->message_dispatcher->dispatch_call_result(call_result); @@ -2281,7 +2282,7 @@ void ChargePointImpl::handleSetChargingProfileRequest(ocpp::Call0 and connector_id <= this->configuration->getNumberOfConnectors()) { + if (connector_id > 0 and connector_id <= this->configuration->getNumberOfConnectors()) { const auto supported_purpose_types = this->configuration->getSupportedChargingProfilePurposeTypes(); if (std::find(supported_purpose_types.begin(), supported_purpose_types.end(), call.msg.csChargingProfiles.chargingProfilePurpose) == supported_purpose_types.end()) { @@ -2370,7 +2371,7 @@ void ChargePointImpl::handleClearChargingProfileRequest(ocpp::Call this->configuration->getNumberOfConnectors())){ + if (call.msg.id.has_value() && (call.msg.id < 0 || call.msg.id > this->configuration->getNumberOfConnectors())) { connectorIdValid = false; } @@ -2383,9 +2384,9 @@ void ChargePointImpl::handleClearChargingProfileRequest(ocpp::Callsmart_charging_handler->clear_all_profiles_with_filter( call.msg.id, call.msg.connectorId, call.msg.stackLevel, call.msg.chargingProfilePurpose, true)) { response.status = ClearChargingProfileStatus::Accepted; - } else if (!call.msg.id and - this->smart_charging_handler->clear_all_profiles_with_filter( - std::nullopt, call.msg.connectorId, call.msg.stackLevel, call.msg.chargingProfilePurpose, false)) { + } else if (!call.msg.id and this->smart_charging_handler->clear_all_profiles_with_filter( + std::nullopt, call.msg.connectorId, call.msg.stackLevel, + call.msg.chargingProfilePurpose, false)) { response.status = ClearChargingProfileStatus::Accepted; } } @@ -2894,7 +2895,7 @@ void ChargePointImpl::handleReserveNowRequest(ocpp::Call call response.status = ReservationStatus::Rejected; bool connectorIdInRange = false; - if (call.msg.connectorId <0 || call.msg.connectorId > this->configuration->getNumberOfConnectors()) { + if (call.msg.connectorId < 0 || call.msg.connectorId > this->configuration->getNumberOfConnectors()) { connectorIdInRange = false; }