} else {
for (l = db_svc_dev_list; NULL != l; l = g_slist_next(l)) {
db_svc_dev_info_t *db_svc = l->data;
+
_uam_core_update_svc_dev_info((char *)&(db_svc->device_id), db_svc->type,
(char *)&(db_svc->svc), db_svc->discriminant);
}
GSList *l;
uam_db_user_info_t *user;
uam_svc_dev_info_t *svc_dev = NULL;
+ gboolean live_monitoring = FALSE;
ret_if(NULL == tech);
ret_if(NULL == tech->svc_list);
if (UAM_DETECT_PRESENCE != mon->mode)
continue;
+ /*
+ * For current service, if any its running monitor has same sensor
+ * and detection_mode
+ */
+ live_monitoring = TRUE;
+
user->timestamp = _uam_get_timestamp();
UAM_INFO("sensor [%d]", sensor);
svc->name,
user->timestamp);
}
+
+ if (live_monitoring)
+ svc_dev->timestamp = _uam_get_timestamp();
}
FUNC_EXIT;
int ret = UAM_ERROR_NONE;
GSList *l;
-
uam_db_user_info_t *user;
uam_db_device_info_t *device;
uam_db_tech_info_t *tech;
return ret;
}
+ /* Send user presence event and update service_device timestamp */
__send_user_presence_event(tech, sensor, dev_info->device_id);
__uam_db_end_transaction(1);
{
FUNC_ENTRY;
GSList *l1;
+ GSList *s;
int indx = 0;
int ret = UAM_ERROR_NONE;
+ uam_svc_dev_info_t *svc_dev = NULL;
+ uam_device_info_s *dev = NULL;
*count = 0;
/* Calculate number of devices */
UAM_ERR("__copy_tech_info_to_device_info failed");
return ret;
}
+
+ (*device_list)[indx].last_seen = 0;
indx++;
}
UAM_INFO("Count = %d, indx = %d", *count, indx);
+
+ /* Update service specific device timestamp */
+ for (s = svc_devs; s; s = g_slist_next(s)) {
+ svc_dev = s->data;
+
+ if (!svc_dev || !svc_dev->device_id || !svc_dev->service)
+ continue;
+ if (g_strcmp0(svc_dev->service, service->name))
+ continue;
+
+ for (indx = 0; indx < *count; indx++) {
+ dev = &((*device_list)[indx]);
+
+ if (svc_dev->tech_type != dev->type ||
+ g_strcmp0(svc_dev->device_id, dev->device_id))
+ continue;
+
+ dev->last_seen = svc_dev->timestamp;
+ }
+ }
+
FUNC_EXIT;
return ret;
}