Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
  • Loading branch information
maaikez committed Dec 4, 2024
1 parent 71e2fda commit 8500fbd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions include/ocpp/v201/functional_blocks/reservation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class EvseManagerInterface;

class ReservationInterface : public MessageHandlerInterface {
public:
virtual ~ReservationInterface() {};
virtual ~ReservationInterface(){};
virtual void on_reservation_status(const int32_t reservation_id, const ReservationUpdateStatusEnum status) = 0;
virtual ocpp::ReservationCheckStatus
is_evse_reserved_for_other(const EvseInterface& evse, const IdToken& id_token,
Expand Down Expand Up @@ -61,7 +61,6 @@ class Reservation : public ReservationInterface {
virtual void on_reservation_cleared(const int32_t evse_id, const int32_t connector_id) override;

private: // Functions

void handle_reserve_now_request(Call<ReserveNowRequest> call);
void handle_cancel_reservation_callback(Call<CancelReservationRequest> call);

Expand Down
3 changes: 2 additions & 1 deletion lib/ocpp/v201/functional_blocks/reservation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ void Reservation::handle_reserve_now_request(Call<ReserveNowRequest> call) {
.value_or(false)) {
status_info = "Reservation is not available";
reservation_available = false;
} else if (!this->device_model->get_optional_value<bool>(ControllerComponentVariables::ReservationCtrlrEnabled).value_or(false)) {
} else if (!this->device_model->get_optional_value<bool>(ControllerComponentVariables::ReservationCtrlrEnabled)
.value_or(false)) {
reservation_available = false;
status_info = "Reservation is not enabled";
}
Expand Down
9 changes: 3 additions & 6 deletions tests/lib/ocpp/v201/functional_blocks/test_reservation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,15 @@ class ReservationTest : public ::testing::Test {

// Check values
const bool reservation_available_in_device_model =
dm->get_optional_value<bool>(ControllerComponentVariables::ReservationCtrlrAvailable)
.value_or(false);
dm->get_optional_value<bool>(ControllerComponentVariables::ReservationCtrlrAvailable).value_or(false);
EXPECT_EQ(reservation_available_in_device_model, is_reservation_available);

const bool reservation_enabled_in_device_model =
dm->get_optional_value<bool>(ControllerComponentVariables::ReservationCtrlrEnabled)
.value_or(false);
dm->get_optional_value<bool>(ControllerComponentVariables::ReservationCtrlrEnabled).value_or(false);
EXPECT_EQ(reservation_enabled_in_device_model, is_reservation_enabled);

const bool non_evse_specific_enabled_device_model =
dm->get_optional_value<bool>(ControllerComponentVariables::ReservationCtrlrNonEvseSpecific)
.value_or(false);
dm->get_optional_value<bool>(ControllerComponentVariables::ReservationCtrlrNonEvseSpecific).value_or(false);
EXPECT_EQ(non_evse_specific_enabled_device_model, non_evse_specific_enabled);

return dm;
Expand Down

0 comments on commit 8500fbd

Please sign in to comment.