Skip to content
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

Fix bug in ClearChargingProfile.req #872

Merged
merged 2 commits into from
Nov 21, 2024
Merged
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
8 changes: 3 additions & 5 deletions lib/ocpp/v16/charge_point_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2359,8 +2359,6 @@ void ChargePointImpl::handleGetCompositeScheduleRequest(ocpp::Call<GetCompositeS
void ChargePointImpl::handleClearChargingProfileRequest(ocpp::Call<ClearChargingProfileRequest> call) {
EVLOG_debug << "Received ClearChargingProfileRequest: " << call.msg << "\nwith messageId: " << call.uniqueId;

// FIXME(kai): after a profile has been deleted we must notify interested parties (energy manager?)

ClearChargingProfileResponse response;
response.status = ClearChargingProfileStatus::Unknown;

Expand All @@ -2372,9 +2370,9 @@ void ChargePointImpl::handleClearChargingProfileRequest(ocpp::Call<ClearCharging
this->smart_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 (this->smart_charging_handler->clear_all_profiles_with_filter(
call.msg.id, 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;
}

Expand Down