From 198692f036f1ee7e3587613d74abfabed09ada0e Mon Sep 17 00:00:00 2001 From: "saerome.kim" Date: Fri, 25 Oct 2019 12:38:59 +0900 Subject: Fix the problem that status_changed_cb is not reported - Problem: Without ABSENCE detection, status_changed_cb never be notified. - Cause: Make decision whether ABSNECE detection is started or not. - Solution: When at least one more detection started, make status_changed_cb be called continously. Change-Id: Ic98982884b51b887619bb14259ae1d662be76d26 Signed-off-by: saerome.kim --- packaging/capi-network-ua.spec | 2 +- src/user-awareness-monitors.c | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packaging/capi-network-ua.spec b/packaging/capi-network-ua.spec index 577837e..4a4e406 100644 --- a/packaging/capi-network-ua.spec +++ b/packaging/capi-network-ua.spec @@ -1,6 +1,6 @@ Name: capi-network-ua Summary: User Awareness Framework CAPI -Version: 0.12.4 +Version: 0.12.5 Release: 1 License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c index 5be4551..ba890ad 100644 --- a/src/user-awareness-monitors.c +++ b/src/user-awareness-monitors.c @@ -1016,16 +1016,28 @@ void _ua_monitor_handle_sensor_status_changed(uam_sensor_info_s *info) _ua_get_error_string(ret)); } + UA_INFO("sensor which state has changed [%x]", sensor_info->bitmask); for (l = ua_monitor_list; l; l = g_slist_next(l)) { ua_monitor_s *monitor = l->data; - if (!monitor || (!monitor->presence_detection_started - && !monitor->internal_presence_started) - || (!monitor->absence_detection_started)) + if (!monitor) { + UA_WARN("skip!! monitor is null"); + continue; + } + + if (!monitor->internal_presence_started || + (!monitor->presence_detection_started && + !monitor->internal_presence_started)) { + UA_WARN("skip!! because detection does not start [%x]", + monitor->sensor_bitmask); continue; + } - if (0 == (sensor_info->bitmask & monitor->sensor_bitmask)) + if (0 == (sensor_info->bitmask & monitor->sensor_bitmask)) { + UA_WARN("skip!! the reported sensor is not added [%x]", + monitor->sensor_bitmask); continue; + } if (monitor->sensor_status_cb.callback) ((ua_sensor_status_changed_cb)monitor->sensor_status_cb.callback)( -- cgit v1.2.3