@@ -200,6 +200,12 @@ ErrorCode E3Interface::register_sm(std::unique_ptr<ServiceModel> sm) {
200200 return SmRegistry::instance ().register_sm (std::move (sm));
201201}
202202
203+ void E3Interface::notify_dapp_status_changed () {
204+ if (dapp_status_changed_handler_) {
205+ dapp_status_changed_handler_ ();
206+ }
207+ }
208+
203209// =========================================================================
204210// Thread Entry Points
205211// =========================================================================
@@ -433,6 +439,7 @@ void E3Interface::handle_setup_request(const SetupRequest& request, uint32_t req
433439 if (result == ErrorCode::SUCCESS) {
434440 response_code = ResponseCode::POSITIVE;
435441 E3_LOG_INFO (LOG_TAG) << " dApp '" << request.dapp_name << " ' registered with assigned ID " << assigned_dapp_id;
442+ notify_dapp_status_changed ();
436443 } else {
437444 E3_LOG_ERROR (LOG_TAG) << " Failed to register dApp '" << request.dapp_name << " ': " << error_code_to_string (result);
438445 }
@@ -508,6 +515,9 @@ void E3Interface::handle_subscription_request(const SubscriptionRequest& request
508515 E3_LOG_INFO (LOG_TAG) << " Subscription added: dApp " << request.dapp_identifier
509516 << " -> RAN function " << request.ran_function_identifier
510517 << " (subscription_id=" << subscription_id << " )" ;
518+ if (result == ErrorCode::SUCCESS) {
519+ notify_dapp_status_changed ();
520+ }
511521 } else {
512522 E3_LOG_ERROR (LOG_TAG) << " Failed to add subscription: "
513523 << error_code_to_string (result);
@@ -543,6 +553,7 @@ void E3Interface::handle_subscription_delete(const SubscriptionDelete& del, uint
543553 if (result == ErrorCode::SUCCESS) {
544554 response_code = ResponseCode::POSITIVE;
545555 E3_LOG_INFO (LOG_TAG) << " Subscription " << del.subscription_id << " removed for dApp " << del.dapp_identifier ;
556+ notify_dapp_status_changed ();
546557 } else {
547558 E3_LOG_ERROR (LOG_TAG) << " Failed to remove subscription: "
548559 << error_code_to_string (result);
@@ -610,6 +621,7 @@ void E3Interface::handle_dapp_disconnection(uint32_t dapp_id) {
610621 if (result == ErrorCode::SUCCESS) {
611622 E3_LOG_INFO (LOG_TAG) << " dApp " << dapp_id << " unregistered, "
612623 << subscriptions.size () << " subscriptions removed" ;
624+ notify_dapp_status_changed ();
613625 } else {
614626 E3_LOG_ERROR (LOG_TAG) << " Failed to unregister dApp " << dapp_id << " : "
615627 << error_code_to_string (result);
0 commit comments