Commit 84d24230 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Remove redundant heartbeat timeout events

parent d4678312
...@@ -678,7 +678,7 @@ void nrf_profile::subscribe_heartbeat_timeout_nfupdate(uint64_t ms) { ...@@ -678,7 +678,7 @@ void nrf_profile::subscribe_heartbeat_timeout_nfupdate(uint64_t ms) {
if (first_update) { if (first_update) {
ms = ms + 2000; // Not a realtime NF: adding 2000ms interval between the ms = ms + 2000; // Not a realtime NF: adding 2000ms interval between the
// expected NF update message and HBT // expected NF update message and HBT
task_connection = m_event_sub.subscribe_task_tick( hb_update_connection = m_event_sub.subscribe_task_tick(
boost::bind(&nrf_profile::handle_heartbeart_timeout_nfupdate, this, _1), boost::bind(&nrf_profile::handle_heartbeart_timeout_nfupdate, this, _1),
interval, ms + interval); interval, ms + interval);
first_update = false; first_update = false;
...@@ -687,8 +687,8 @@ void nrf_profile::subscribe_heartbeat_timeout_nfupdate(uint64_t ms) { ...@@ -687,8 +687,8 @@ void nrf_profile::subscribe_heartbeat_timeout_nfupdate(uint64_t ms) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool nrf_profile::unsubscribe_heartbeat_timeout_nfupdate() { bool nrf_profile::unsubscribe_heartbeat_timeout_nfupdate() {
if (task_connection.connected()) { if (hb_update_connection.connected()) {
task_connection.disconnect(); hb_update_connection.disconnect();
Logger::nrf_app().debug( Logger::nrf_app().debug(
"Unsubscribe to the Heartbeat Timer timeout event (after NF Update)"); "Unsubscribe to the Heartbeat Timer timeout event (after NF Update)");
return true; return true;
...@@ -748,6 +748,7 @@ void nrf_profile::handle_heartbeart_timeout_nfupdate(uint64_t ms) { ...@@ -748,6 +748,7 @@ void nrf_profile::handle_heartbeart_timeout_nfupdate(uint64_t ms) {
// TODO: Notify to the subscribers // TODO: Notify to the subscribers
// notifCondition with ["monitoredAttributes": [ "/nfStatus""] // notifCondition with ["monitoredAttributes": [ "/nfStatus""]
m_event_sub.nf_status_profile_changed(nf_instance_id); m_event_sub.nf_status_profile_changed(nf_instance_id);
unsubscribe_heartbeat_timeout_nfupdate();
} }
set_status_updated(false); set_status_updated(false);
} }
......
...@@ -117,7 +117,7 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> { ...@@ -117,7 +117,7 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> {
virtual ~nrf_profile() { virtual ~nrf_profile() {
Logger::nrf_app().debug("Delete NRF Profile instance..."); Logger::nrf_app().debug("Delete NRF Profile instance...");
if (task_connection.connected()) task_connection.disconnect(); if (hb_update_connection.connected()) task_connection.disconnect();
if (first_hb_connection.connected()) first_hb_connection.disconnect(); if (first_hb_connection.connected()) first_hb_connection.disconnect();
} }
...@@ -514,7 +514,7 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> { ...@@ -514,7 +514,7 @@ class nrf_profile : public std::enable_shared_from_this<nrf_profile> {
protected: protected:
nrf_event& m_event_sub; nrf_event& m_event_sub;
bs2::connection bs2::connection
task_connection; // connection for the HBT timeout (after NF Update) hb_update_connection; // connection for the HBT timeout (after NF Update)
bs2::connection first_hb_connection; // connection for first HBT timeout bs2::connection first_hb_connection; // connection for first HBT timeout
// (after NF Registration) // (after NF Registration)
bool first_update; bool first_update;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment