Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
Signed-off-by: Kai-Uwe Hermann <[email protected]>
  • Loading branch information
hikinggrass committed Dec 4, 2024
1 parent cdfecbf commit 979f75a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/ocpp/v201/charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3015,7 +3015,7 @@ void ChargePoint::handle_trigger_message(Call<TriggerMessageRequest> call) {
return;
}

auto send_evse_message = [&](std::function<void(int32_t evse_id, EvseInterface & evse)> send) {
auto send_evse_message = [&](std::function<void(int32_t evse_id, EvseInterface& evse)> send) {
if (evse_ptr != nullptr) {
send(msg.evse.value().id, *evse_ptr);
} else {
Expand Down Expand Up @@ -3365,8 +3365,8 @@ void ChargePoint::handle_reserve_now_request(Call<ReserveNowRequest> call) {
// Check if there is a connector available for this evse id.
if (!does_connector_exist(static_cast<uint32_t>(evse_id.value()), request.connectorType)) {
EVLOG_info << "Trying to make a reservation for connector type "
<< request.connectorType.value_or(ConnectorEnumStringType::Unknown)
<< " for evse " << evse_id.value() << ", but this connector type does not exist.";
<< request.connectorType.value_or(ConnectorEnumStringType::Unknown) << " for evse "
<< evse_id.value() << ", but this connector type does not exist.";
send_reserve_now_rejected_response(call.uniqueId, "Connector type does not exist");
return;
}
Expand Down
7 changes: 4 additions & 3 deletions lib/ocpp/v201/evse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ std::optional<ConnectorStatusEnum> Evse::get_connector_status(std::optional<CiSt

const ConnectorStatusEnum connector_status = connector->get_effective_connector_status();

const CiString<20> evse_connector_type = this->get_evse_connector_type(i).value_or(ConnectorEnumStringType::Unknown);
const CiString<20> evse_connector_type =
this->get_evse_connector_type(i).value_or(ConnectorEnumStringType::Unknown);
const CiString<20> input_connector_type = connector_type.value_or(ConnectorEnumStringType::Unknown);
const bool connector_type_unknown =
evse_connector_type == ConnectorEnumStringType::Unknown || input_connector_type == ConnectorEnumStringType::Unknown;
const bool connector_type_unknown = evse_connector_type == ConnectorEnumStringType::Unknown ||
input_connector_type == ConnectorEnumStringType::Unknown;

if (connector_type_unknown || evse_connector_type == input_connector_type) {
type_found = true;
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/ocpp/v201/mocks/evse_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class EvseMock : public EvseInterface {
MOCK_METHOD(int32_t, get_id, (), (const));
MOCK_METHOD(uint32_t, get_number_of_connectors, (), (const));
MOCK_METHOD(bool, does_connector_exist, (CiString<20> connector_type));
MOCK_METHOD(std::optional<ConnectorStatusEnum>, get_connector_status,
(std::optional<CiString<20>> connector_type));
MOCK_METHOD(std::optional<ConnectorStatusEnum>, get_connector_status, (std::optional<CiString<20>> connector_type));
MOCK_METHOD(void, open_transaction,
(const std::string& transaction_id, const int32_t connector_id, const DateTime& timestamp,
const MeterValue& meter_start, const std::optional<IdToken>& id_token,
Expand Down

0 comments on commit 979f75a

Please sign in to comment.