From b6992cd53b7e2d1e0bef68948a659ba7da2eaa87 Mon Sep 17 00:00:00 2001 From: "Maaike Zijderveld, Alfen" Date: Thu, 1 Feb 2024 17:17:17 +0100 Subject: [PATCH] 437: Fix delay in bootnotification Signed-off-by: Maaike Zijderveld, Alfen --- lib/ocpp/v201/charge_point.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/ocpp/v201/charge_point.cpp b/lib/ocpp/v201/charge_point.cpp index 6df700d36..09b74fdce 100644 --- a/lib/ocpp/v201/charge_point.cpp +++ b/lib/ocpp/v201/charge_point.cpp @@ -1870,6 +1870,13 @@ void ChargePoint::handle_boot_notification_response(CallResultregistration_status = msg.status; if (this->registration_status == RegistrationStatusEnum::Accepted) { + // B01.FR.06 Only use boot timestamp if TimeSource contains Heartbeat + if (this->callbacks.time_sync_callback.has_value() && + this->device_model->get_value(ControllerComponentVariables::TimeSource).find("Heartbeat") != + std::string::npos) { + this->callbacks.time_sync_callback.value()(msg.currentTime); + } + this->remove_network_connection_profiles_below_actual_security_profile(); // get transaction messages from db (if there are any) so they can be sent again. @@ -1881,12 +1888,6 @@ void ChargePoint::handle_boot_notification_response(CallResultinit_certificate_expiration_check_timers(); this->update_aligned_data_interval(); - // B01.FR.06 Only use boot timestamp if TimeSource contains Heartbeat - if (this->callbacks.time_sync_callback.has_value() && - this->device_model->get_value(ControllerComponentVariables::TimeSource).find("Heartbeat") != - std::string::npos) { - this->callbacks.time_sync_callback.value()(msg.currentTime); - } this->component_state_manager->send_status_notification_all_connectors(); if (this->bootreason == BootReasonEnum::RemoteReset) {