Skip to content

Commit 42d3740

Browse files
author
Coury Richards
committed
updated: added optional evse_id to on_handle method
Signed-off-by: Coury Richards <146002925+couryrr-afs@users.noreply.github.com>
1 parent 876f338 commit 42d3740

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

include/ocpp/v201/charge_point.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,11 @@ class ChargePointInterface {
262262
/// \brief Notifies the ChargePoint that an external limit has been cleared.
263263
/// This shall send a ClearedChargingLimitRequest when called.
264264
// This may send TransactionEventRequest if the \p percentage_delta is greater than our LimitChangeSignificance.
265+
/// \param evse_id if provided checks for transactions on the provided evse
265266
/// \param percentage_delta the percent changed from the existing limits
266267
/// \param source the source of the external limit
267-
virtual void on_external_limit_cleared(double percentage_delta, ChargingLimitSourceEnum source) = 0;
268+
virtual void on_external_limit_cleared(std::optional<int32_t> evse_id, double percentage_delta,
269+
ChargingLimitSourceEnum source) = 0;
268270

269271
/// \brief Data transfer mechanism initiated by charger
270272
/// \param vendorId
@@ -897,8 +899,9 @@ class ChargePoint : public ChargePointInterface, private ocpp::ChargingStationBa
897899
void on_external_limits_changed(const std::variant<ConstantChargingLimit, ChargingSchedule>& limit,
898900
double percentage_delta, ChargingLimitSourceEnum source,
899901
std::optional<int32_t> evse_id) override;
900-
901-
void on_external_limit_cleared(double percentage_delta, ChargingLimitSourceEnum source) override;
902+
903+
void on_external_limit_cleared(std::optional<int32_t> evse_id, double percentage_delta,
904+
ChargingLimitSourceEnum source) override;
902905

903906
std::optional<DataTransferResponse> data_transfer_req(const CiString<255>& vendorId,
904907
const std::optional<CiString<50>>& messageId,

lib/ocpp/v201/charge_point.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,8 @@ void ChargePoint::on_external_limits_changed(const std::variant<ConstantCharging
11121112
}
11131113
}
11141114

1115-
void ChargePoint::on_external_limit_cleared(double percentage_delta, ChargingLimitSourceEnum source) {
1115+
void ChargePoint::on_external_limit_cleared(std::optional<int32_t> evse_id, double percentage_delta,
1116+
ChargingLimitSourceEnum source) {
11161117
auto request = this->smart_charging_handler->handle_external_limit_cleared(percentage_delta, source);
11171118

11181119
auto [cleared_charging_limit_request, transaction_event_requests] = request;

tests/lib/ocpp/v201/test_charge_point.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <gmock/gmock.h>
2626
#include <gtest/gtest.h>
2727
#include <memory>
28+
#include <optional>
2829
#include <variant>
2930

3031
static const int DEFAULT_EVSE_ID = 1;
@@ -984,7 +985,7 @@ TEST_F(ChargepointTestFixtureV201, K13_OnExternalLimitsCleared_CallsHandler) {
984985

985986
EXPECT_CALL(*smart_charging_handler, handle_external_limit_cleared(deltaChanged, source));
986987

987-
charge_point->on_external_limit_cleared(deltaChanged, source);
988+
charge_point->on_external_limit_cleared(std::nullopt, deltaChanged, source);
988989
}
989990

990991
} // namespace ocpp::v201

0 commit comments

Comments
 (0)