Commit df633285 authored by Omar Kallel's avatar Omar Kallel

Ticket refs #2673: TR069: No '4 value change' sent in case of active passive notification

parent e848013d
Pipeline #1607 passed with stage
in 21 seconds
......@@ -1229,7 +1229,7 @@ int cwmp_init(int argc, char** argv,struct cwmp *cwmp)
return error;
}
cwmp_get_deviceid(cwmp);
dm_entry_load_enabled_notify(DM_CWMP, cwmp->conf.amd_version, cwmp->conf.instance_mode);
dm_entry_load_enabled_notify(DM_CWMP, cwmp->conf.amd_version, cwmp->conf.instance_mode, add_list_value_change, send_active_value_change);
return CWMP_OK;
}
......
......@@ -644,6 +644,30 @@ int run_session_end_func (struct session *session)
return CWMP_OK;
}
void add_list_value_change(char *param_name, char *param_data, char *param_type)
{
pthread_mutex_lock(&(mutex_value_change));
add_dm_parameter_tolist(&list_value_change, param_name, param_data, param_type);
pthread_mutex_unlock(&(mutex_value_change));
}
void send_active_value_change(void)
{
struct cwmp *cwmp = &cwmp_main;
struct event_container *event_container;
pthread_mutex_lock(&(cwmp->mutex_session_queue));
event_container = cwmp_add_event_container(cwmp, EVENT_IDX_4VALUE_CHANGE, "");
if (event_container == NULL)
{
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
return;
}
cwmp_save_event_container(cwmp,event_container);
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
pthread_cond_signal(&(cwmp->threshold_session_send));
return;
}
int cwmp_apply_acs_changes ()
{
int error;
......
......@@ -174,13 +174,6 @@ void free_dm_parameter_all_fromlist(struct list_head *list)
}
}
void add_list_value_change(char *param_name, char *param_data, char *param_type)
{
pthread_mutex_lock(&(mutex_value_change));
add_dm_parameter_tolist(&list_value_change, param_name, param_data, param_type);
pthread_mutex_unlock(&(mutex_value_change));
}
void add_lw_list_value_change(char *param_name, char *param_data, char *param_type)
{
add_dm_parameter_tolist(&list_lw_value_change, param_name, param_data, param_type);
......@@ -286,24 +279,6 @@ void cwmp_lwnotification()
FREE(msg_out);
}
void send_active_value_change(void)
{
struct cwmp *cwmp = &cwmp_main;
struct event_container *event_container;
pthread_mutex_lock(&(cwmp->mutex_session_queue));
event_container = cwmp_add_event_container(cwmp, EVENT_IDX_4VALUE_CHANGE, "");
if (event_container == NULL)
{
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
return;
}
cwmp_save_event_container(cwmp,event_container);
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
pthread_cond_signal(&(cwmp->threshold_session_send));
return;
}
void cwmp_add_notification(void)
{
int fault, iscopy;
......
......@@ -319,4 +319,6 @@ int cwmp_move_session_to_session_queue (struct cwmp *cwmp, struct session *sessi
int cwmp_session_destructor (struct cwmp *cwmp, struct session *session);
int cwmp_init(int argc, char** argv,struct cwmp *cwmp);
int cwmp_exit(void);
void add_list_value_change(char *param_name, char *param_data, char *param_type);
void send_active_value_change(void);
#endif /* _CWMP_H__ */
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