@@ -27,10 +27,11 @@ const auto DEFAULT_MAX_MESSAGE_SIZE = 65000;
27
27
bool Callbacks::all_callbacks_valid () const {
28
28
return this ->is_reset_allowed_callback != nullptr and this ->reset_callback != nullptr and
29
29
this ->stop_transaction_callback != nullptr and this ->pause_charging_callback != nullptr and
30
- this ->connector_effective_operative_status_changed_callback != nullptr and
30
+ // this->connector_effective_operative_status_changed_callback != nullptr and
31
31
this ->get_log_request_callback != nullptr and this ->unlock_connector_callback != nullptr and
32
32
this ->remote_start_transaction_callback != nullptr and this ->is_reservation_for_token_callback != nullptr and
33
- this ->update_firmware_request_callback != nullptr and
33
+ this ->update_firmware_request_callback != nullptr and this ->websocket_connected_callback != nullptr and
34
+ this ->websocket_disconnected_callback != nullptr and
34
35
(!this ->variable_changed_callback .has_value () or this ->variable_changed_callback .value () != nullptr ) and
35
36
(!this ->validate_network_profile_callback .has_value () or
36
37
this ->validate_network_profile_callback .value () != nullptr ) and
@@ -682,7 +683,7 @@ void ChargePoint::init_websocket() {
682
683
}
683
684
684
685
this ->websocket = std::make_unique<Websocket>(connection_options, this ->evse_security , this ->logging );
685
- this ->websocket ->register_connected_callback ([this ](const int security_profile) {
686
+ this ->websocket ->register_connected_callback ([this , network_connection_profile ](const int security_profile) {
686
687
this ->message_queue ->resume (this ->message_queue_resume_delay );
687
688
688
689
const auto & security_profile_cv = ControllerComponentVariables::SecurityProfile;
@@ -691,6 +692,9 @@ void ChargePoint::init_websocket() {
691
692
AttributeEnum::Actual, std::to_string (security_profile));
692
693
}
693
694
695
+ // call the registered websocket connected callback
696
+ this ->callbacks .websocket_connected_callback (network_connection_profile);
697
+
694
698
if (this ->registration_status == RegistrationStatusEnum::Accepted and
695
699
this ->time_disconnected .time_since_epoch () != 0s) {
696
700
// handle offline threshold
@@ -723,7 +727,7 @@ void ChargePoint::init_websocket() {
723
727
// Get the current time point using steady_clock
724
728
this ->time_disconnected = std::chrono::steady_clock::now ();
725
729
}
726
-
730
+ this -> callbacks . websocket_disconnected_callback ();
727
731
this ->client_certificate_expiration_check_timer .stop ();
728
732
this ->v2g_certificate_expiration_check_timer .stop ();
729
733
});
0 commit comments