Skip to content

refactor: rename charging profile callback variables for clarity Signed-off-by: thenaserov [email protected] #981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/ocpp/v16/charge_point_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class ChargePointImpl : ocpp::ChargingStationBase {
std::function<void(const ResetType& reset_type)> reset_callback;
std::function<void(const std::string& system_time)> set_system_time_callback;
std::function<void(const BootNotificationResponse& boot_notification_response)> boot_notification_response_callback;
std::function<void()> signal_set_charging_profiles_callback;
std::function<void()> charging_profiles_updated_callback;
std::function<void(bool is_connected)> connection_state_changed_callback;

std::function<GetLogResponse(const GetDiagnosticsRequest& request)> upload_diagnostics_callback;
Expand Down Expand Up @@ -805,7 +805,7 @@ class ChargePointImpl : ocpp::ChargingStationBase {
/// and was accepted. The registered callback could make use of the get_all_composite_charging_schedules in order to
/// retrieve the ChargingProfiles that have been set by the CSMS.
/// \param callback
void register_signal_set_charging_profiles_callback(const std::function<void()>& callback);
void register_charging_profiles_updated_callback(const std::function<void()>& callback);

/// \brief registers a \p callback function that can be used when the connection state to CSMS changes. The
/// connection_state_changed_callback is called when chargepoint has connected to or disconnected from the CSMS.
Expand Down
8 changes: 4 additions & 4 deletions lib/ocpp/v201/functional_blocks/smart_charging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ SmartCharging::SmartCharging(DeviceModel& device_model, EvseManagerInterface& ev
ConnectivityManagerInterface& connectivity_manager,
MessageDispatcherInterface<MessageType>& message_dispatcher,
DatabaseHandlerInterface& database_handler,
std::function<void()> set_charging_profiles_callback) :
std::function<void()> charging_profiles_updated_callback) :
device_model(device_model),
evse_manager(evse_manager),
connectivity_manager(connectivity_manager),
message_dispatcher(message_dispatcher),
database_handler(database_handler),
set_charging_profiles_callback(set_charging_profiles_callback) {
charging_profiles_updated_callback(charging_profiles_updated_callback) {
}

void SmartCharging::handle_message(const ocpp::EnhancedMessage<MessageType>& message) {
Expand Down Expand Up @@ -661,7 +661,7 @@ void SmartCharging::handle_set_charging_profile_req(Call<SetChargingProfileReque
response = this->conform_validate_and_add_profile(msg.chargingProfile, msg.evseId);
if (response.status == ChargingProfileStatusEnum::Accepted) {
EVLOG_debug << "Accepting SetChargingProfileRequest";
this->set_charging_profiles_callback();
this->charging_profiles_updated_callback();
} else {
EVLOG_debug << "Rejecting SetChargingProfileRequest:\n reasonCode: " << response.statusInfo->reasonCode.get()
<< "\nadditionalInfo: " << response.statusInfo->additionalInfo->get();
Expand Down Expand Up @@ -692,7 +692,7 @@ void SmartCharging::handle_clear_charging_profile_req(Call<ClearChargingProfileR
}

if (response.status == ClearChargingProfileStatusEnum::Accepted) {
this->set_charging_profiles_callback();
this->charging_profiles_updated_callback();
}

ocpp::CallResult<ClearChargingProfileResponse> call_result(response, call.uniqueId);
Expand Down
Loading