} uam_detection_params_t;
typedef struct {
- char* sender;
+ char *sender;
unsigned short uid;
char app_id[UAM_APP_ID_MAX_STRING_LEN];
} uam_app_info_t;
int _uam_get_available_sensors(unsigned int *bitmask);
-int _uam_get_default_user(uam_user_info_t* uam_user);
+int _uam_get_default_user(uam_user_info_t * uam_user);
-int _uam_add_user(uam_user_info_t* user);
+int _uam_add_user(uam_user_info_t * user);
-int _uam_remove_user(char* account);
+int _uam_remove_user(char *account);
-int _uam_request_get_user_by_account(char* account, uam_user_info_t* user);
+int _uam_request_get_user_by_account(char *account, uam_user_info_t * user);
-int _uam_request_get_user_by_deviceid(char* device_id, uam_user_info_t* user);
+int _uam_request_get_user_by_deviceid(char *device_id, uam_user_info_t * user);
-int _uam_request_get_user_by_mac(char* mac, uam_user_info_t* user);
+int _uam_request_get_user_by_mac(char *mac, uam_user_info_t * user);
-int _uam_request_add_device(char* account, uam_device_info_t* device);
+int _uam_request_add_device(char *account, uam_device_info_t *device);
-int _uam_request_remove_device(char* account, uam_device_info_t* device);
+int _uam_request_remove_device(char *account, uam_device_info_t *device);
-int _uam_request_remove_device_by_deviceid(const char* device_id, uam_tech_type_e tech_type);
+int _uam_request_remove_device_by_deviceid(const char *device_id, uam_tech_type_e tech_type);
-int _uam_request_remove_device_by_mac(const char* mac);
+int _uam_request_remove_device_by_mac(const char *mac);
-int _uam_request_get_device_by_deviceid(const char* device_id, uam_tech_type_e tech_type, uam_device_info_t* device);
+int _uam_request_get_device_by_deviceid(const char *device_id, uam_tech_type_e tech_type, uam_device_info_t *device);
-int _uam_request_get_device_by_mac(const char* mac, uam_device_info_t* device);
+int _uam_request_get_device_by_mac(const char *mac, uam_device_info_t *device);
int _uam_request_get_devices(GPtrArray **devices_list);
-int _uam_request_get_user_devices(char* account, GPtrArray **devices_list);
+int _uam_request_get_user_devices(char *account, GPtrArray **devices_list);
int _uam_request_set_detection_threshold(unsigned int sensor_type, int presence_threshold, int absence_threshold);
return ret;
}
-UAM_EXPORT_API int _uam_get_default_user(uam_user_info_t* user)
+UAM_EXPORT_API int _uam_get_default_user(uam_user_info_t *user)
{
FUNC_ENTRY;
int ret;
if (UAM_ERROR_NONE == ret) {
if (out_param->len > 0) {
- uam_user_info_t* info;
+ uam_user_info_t *info;
info = &g_array_index(out_param, uam_user_info_t, 0);
memcpy(user, info, sizeof(uam_user_info_t));
return ret;
}
-UAM_EXPORT_API int _uam_add_user(uam_user_info_t* user)
+UAM_EXPORT_API int _uam_add_user(uam_user_info_t *user)
{
FUNC_ENTRY;
int ret;
return ret;
}
-UAM_EXPORT_API int _uam_remove_user(char* account)
+UAM_EXPORT_API int _uam_remove_user(char *account)
{
FUNC_ENTRY;
int ret;
return ret;
}
-UAM_EXPORT_API int _uam_request_get_user_by_account(char* account, uam_user_info_t* user)
+UAM_EXPORT_API int _uam_request_get_user_by_account(char *account,
+ uam_user_info_t *user)
{
FUNC_ENTRY;
int ret;
if (UAM_ERROR_NONE == ret) {
if (out_param->len > 0) {
- uam_user_info_t* info;
+ uam_user_info_t *info;
info = &g_array_index(out_param, uam_user_info_t, 0);
memcpy(user, info, sizeof(uam_user_info_t));
return ret;
}
-UAM_EXPORT_API int _uam_request_get_user_by_deviceid(char* device_id, uam_user_info_t* user)
+UAM_EXPORT_API int _uam_request_get_user_by_deviceid(char *device_id,
+ uam_user_info_t *user)
{
FUNC_ENTRY;
int ret;
if (UAM_ERROR_NONE == ret) {
if (out_param->len > 0) {
- uam_user_info_t* info;
+ uam_user_info_t * info;
info = &g_array_index(out_param, uam_user_info_t, 0);
memcpy(user, info, sizeof(uam_user_info_t));
return ret;
}
-UAM_EXPORT_API int _uam_request_get_user_by_mac(char* mac, uam_user_info_t* user)
+UAM_EXPORT_API int _uam_request_get_user_by_mac(char *mac,
+ uam_user_info_t *user)
{
FUNC_ENTRY;
int ret;
if (UAM_ERROR_NONE == ret) {
if (out_param->len > 0) {
- uam_user_info_t* info;
+ uam_user_info_t * info;
info = &g_array_index(out_param, uam_user_info_t, 0);
memcpy(user, info, sizeof(uam_user_info_t));
return ret;
}
-UAM_EXPORT_API int _uam_request_add_device(char* account, uam_device_info_t* device)
+UAM_EXPORT_API int _uam_request_add_device(char *account,
+ uam_device_info_t *device)
{
FUNC_ENTRY;
int ret;
return ret;
}
-UAM_EXPORT_API int _uam_request_remove_device(char* account, uam_device_info_t* device)
+UAM_EXPORT_API int _uam_request_remove_device(char *account,
+ uam_device_info_t *device)
{
FUNC_ENTRY;
int ret;
return ret;
}
-UAM_EXPORT_API int _uam_request_remove_device_by_deviceid(const char* device_id, uam_tech_type_e tech_type)
+UAM_EXPORT_API int _uam_request_remove_device_by_deviceid(
+ const char *device_id, uam_tech_type_e tech_type)
{
FUNC_ENTRY;
int ret;
return ret;
}
-UAM_EXPORT_API int _uam_request_remove_device_by_mac(const char* mac)
+UAM_EXPORT_API int _uam_request_remove_device_by_mac(const char *mac)
{
FUNC_ENTRY;
int ret;
return ret;
}
-UAM_EXPORT_API int _uam_request_get_device_by_deviceid(const char* device_id, uam_tech_type_e tech_type, uam_device_info_t* device)
+UAM_EXPORT_API int _uam_request_get_device_by_deviceid(const char *device_id,
+ uam_tech_type_e tech_type, uam_device_info_t *device)
{
FUNC_ENTRY;
int ret;
return ret;
}
-UAM_EXPORT_API int _uam_request_get_device_by_mac(const char* mac, uam_device_info_t* device)
+UAM_EXPORT_API int _uam_request_get_device_by_mac(const char *mac,
+ uam_device_info_t *device)
{
FUNC_ENTRY;
int ret;
return ret;
}
-UAM_EXPORT_API int _uam_request_get_user_devices(char* account, GPtrArray **devices_list)
+UAM_EXPORT_API int _uam_request_get_user_devices(char *account, GPtrArray **devices_list)
{
FUNC_ENTRY;
int ret;
ret_if(NULL == event_info);
- if (0 != strncasecmp(object_path,
- UAM_EVENT_PATH, strlen(UAM_EVENT_PATH)))
+ if (0 != strcasecmp(object_path, UAM_EVENT_PATH))
return;
- if (0 != strncasecmp(interface_name,
- UAM_EVENT_INTERFACE, strlen(UAM_EVENT_INTERFACE)))
+ if (0 != strcasecmp(interface_name, UAM_EVENT_INTERFACE))
return;
- if (0 == strncasecmp(signal_name, UAM_SIGNAL_USER_PRESENCE_DETECTED,
- strlen(UAM_SIGNAL_USER_PRESENCE_DETECTED))) {
+ if (0 == strcasecmp(signal_name, UAM_SIGNAL_USER_PRESENCE_DETECTED)) {
uam_detection_event_data_t event_data;
unsigned int sensor_bitmask;
char *account = NULL;
__uam_send_event(event, result, &event_data,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_USER_ABSENCE_DETECTED,
- strlen(UAM_SIGNAL_USER_ABSENCE_DETECTED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_USER_ABSENCE_DETECTED)) {
uam_detection_event_data_t event_data;
unsigned int sensor_bitmask;
char *account = NULL;
__uam_send_event(event, result, &event_data,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_PRESENCE_DETECTED,
- strlen(UAM_SIGNAL_PRESENCE_DETECTED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_PRESENCE_DETECTED)) {
unsigned int sensor_bitmask;
g_variant_get(parameters, "(u)", &sensor_bitmask);
__uam_send_event(event, result, &sensor_bitmask,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_ABSENCE_DETECTED,
- strlen(UAM_SIGNAL_ABSENCE_DETECTED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_ABSENCE_DETECTED)) {
unsigned int sensor_bitmask;
g_variant_get(parameters, "(u)", &sensor_bitmask);
__uam_send_event(event, result, &sensor_bitmask,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_SENSOR_STATE_READY,
- strlen(UAM_SIGNAL_SENSOR_STATE_READY))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_SENSOR_STATE_READY)) {
unsigned int sensor;
g_variant_get(parameters, "(iu)", &result,
event = UAM_EVENT_SENSOR_STATE_READY;
__uam_send_event(event, result, &sensor,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_SENSOR_STATE_NOT_READY,
- strlen(UAM_SIGNAL_SENSOR_STATE_NOT_READY))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_SENSOR_STATE_NOT_READY)) {
unsigned int sensor;
g_variant_get(parameters, "(iu)", &result,
event = UAM_EVENT_SENSOR_STATE_NOT_READY;
__uam_send_event(event, result, &sensor,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_USER_ADDED,
- strlen(UAM_SIGNAL_USER_ADDED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_USER_ADDED)) {
uam_user_info_t user_info;
char *account = NULL;
char *name = NULL;
event = UAM_EVENT_USER_ADDED;
__uam_send_event(event, result, &user_info,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_USER_REMOVED,
- strlen(UAM_SIGNAL_USER_REMOVED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_USER_REMOVED)) {
uam_user_info_t user_info;
char *account = NULL;
char *name = NULL;
event = UAM_EVENT_USER_REMOVED;
__uam_send_event(event, result, &user_info,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_DEVICE_ADDED,
- strlen(UAM_SIGNAL_DEVICE_ADDED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_DEVICE_ADDED)) {
uam_device_info_t dev_info;
int os, type;
char *mac = NULL;
event = UAM_EVENT_DEVICE_ADDED;
__uam_send_event(event, result, &dev_info,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_DEVICE_REMOVED,
- strlen(UAM_SIGNAL_DEVICE_REMOVED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_DEVICE_REMOVED)) {
uam_device_info_t dev_info;
int os, type;
char *mac = NULL;
event = UAM_EVENT_DEVICE_REMOVED;
__uam_send_event(event, result, &dev_info,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_DETECTION_STARTED,
- strlen(UAM_SIGNAL_DETECTION_STARTED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_DETECTION_STARTED)) {
__uam_send_event(UAM_EVENT_DETECTION_STARTED, result, NULL,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_DETECTION_STOPPED,
- strlen(UAM_SIGNAL_DETECTION_STOPPED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_DETECTION_STOPPED)) {
__uam_send_event(UAM_EVENT_DETECTION_STOPPED, result, NULL,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_DEVICE_FOUND,
- strlen(UAM_SIGNAL_DEVICE_FOUND))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_DEVICE_FOUND)) {
uam_device_info_t dev_info;
int os, type;
char *mac = NULL;
event = UAM_EVENT_DEVICE_FOUND;
__uam_send_event(event, result, &dev_info,
event_info->cb, event_info->user_data);
- } else if (0 == strncasecmp(signal_name, UAM_SIGNAL_SCAN_COMPLETED,
- strlen(UAM_SIGNAL_SCAN_COMPLETED))) {
+ } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_SCAN_COMPLETED)) {
event = UAM_EVENT_SCAN_COMPLETED;
__uam_send_event(event, result, NULL,
GArray *out_param, int result);
int _uam_manager_send_event(
- const char* dest, int event, GVariant *param);
+ const char *dest, int event, GVariant *param);
GDBusConnection *_uam_manager_get_gdbus_conn(void);
const char* _uam_get_sensor_str(unsigned int ids);
-int _uam_register_app_info(char* sender, uam_app_info_t app_info);
+int _uam_register_app_info(char *sender, uam_app_info_t app_info);
-int _uam_deregister_app_info(char* sender, uam_app_info_t app_info);
+int _uam_deregister_app_info(char *sender, uam_app_info_t app_info);
#ifdef __cplusplus
}
return UAP_STATUS_SUCCESS;
}
-static int remove_device(const char* device_id, int type)
+static int remove_device(const char *device_id, int type)
{
FUNC_ENTRY;
UAM_ADDR_TYPE_BT == addr->addr_type ||
UAM_ADDR_TYPE_P2P == addr->addr_type ||
UAM_ADDR_TYPE_WIFI == addr->addr_type)
- if (!strncasecmp(addr->address, mac,
- UAM_MAC_ADDRESS_STRING_LEN)) {
+ if (!strcasecmp(addr->address, mac)) {
UAM_DBG("Device found Mac: %s, type: %d",
addr->address, addr->addr_type);
return tech;
UAM_ADDR_TYPE_BT == addr->addr_type ||
UAM_ADDR_TYPE_P2P == addr->addr_type ||
UAM_ADDR_TYPE_WIFI == addr->addr_type)
- if (!strncasecmp(addr->address, dev->mac,
- UAM_MAC_ADDRESS_STRING_LEN)) {
+ if (!strcasecmp(addr->address, dev->mac)) {
*is_added = TRUE;
break;
}
}
if (dev->type != dev_info->type ||
- strncasecmp(dev->device_id, dev_info->device_id,
- UAM_DEVICE_ID_MAX_STRING_LEN)) {
+ strcasecmp(dev->device_id, dev_info->device_id)) {
UAM_WARN("[%d != %d] || [%s != %s]", dev->type, dev_info->type,
dev->device_id, dev_info->device_id);
_uam_manager_remove_req_ctxt_from_list(info);
if (!addr || (UAM_ADDR_TYPE_IPv4 != addr->addr_type))
continue;
- if (!strncasecmp(addr->address, dev_info->ipv4_addr,
- UAM_MAC_ADDRESS_STRING_LEN))
+ if (!strcasecmp(addr->address, dev_info->ipv4_addr))
is_updated = FALSE;
else
UAM_DBG("Old IPv4: %s, New IPv4: %s",
}
ret = _uam_pm_start_search_active_devices(&sensors, detection_period);
-
if (UAM_ERROR_NONE != ret) {
UAM_ERR("Failed with error: %s (0x%4.4X)",
_uam_manager_error_to_str(ret), ret);
GVariant *param = NULL;
GSList *l;
int done = 0;
- char* name = NULL;
+ char *name = NULL;
for (l = scanners; NULL != l; l = g_slist_next(l)) {
uam_monitor_info_t *scanner = (uam_monitor_info_t *)l->data;
continue;
if (scanner->sensors & sensor) {
-
name = g_strdup(scanner->name);
if (event == UAM_ACTIVE_SCAN_COMPLETED) {
scanner->sensors &= ~(sensor);
FUNC_EXIT;
}
-static void __uam_resume_app(const char* dest)
+static void __uam_resume_app(const char *dest)
{
FUNC_ENTRY;
GSList *l;
}
int _uam_manager_send_event(
- const char* dest, int event, GVariant *param)
+ const char *dest, int event, GVariant *param)
{
FUNC_ENTRY;
char *signal;
return NULL;
}
-int _uam_register_app_info(char* sender, uam_app_info_t app_info)
+int _uam_register_app_info(char *sender, uam_app_info_t app_info)
{
FUNC_ENTRY;
return ret;
}
-int _uam_deregister_app_info(char* sender, uam_app_info_t app_info)
+int _uam_deregister_app_info(char *sender, uam_app_info_t app_info)
{
FUNC_ENTRY;