Tizen Native API  9.0
User Awareness

This provides APIs to manage User Awareness.

Required Header

#include <user-awareness.h>

Overview

Recently, Interactive system has been the computing technology. This module provides that human and the system communicated and interact explicitly using different sensors (e.g. Motion, Brightness, and device detection technologies like ARPing or BLE advertisement).

Related Features

This API is related with the following features:

  • http://tizen.org/feature/user_awareness
  • http://tizen.org/feature/user_awareness.location

It is recommended to design feature related codes in your application for reliability.

You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.

To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on featuring your application can be found from Feature Element.

Functions

int ua_initialize (void)
 Initializes the user awareness framework.
int ua_deinitialize (void)
 De-initializes the user awareness framework.
int ua_foreach_service (ua_service_cb foreach_cb, void *user_data)
 Retrieves handles of all added services.
int ua_get_default_service (ua_service_h *service)
 Gets default service handle.
int ua_get_service_by_name (const char *name, ua_service_h *service)
 Gets service handle by service name for added service.
int ua_monitor_create (ua_monitor_h *monitor)
 Creates the ua monitor's handle.
int ua_monitor_destroy (ua_monitor_h monitor)
 Destroys the ua monitor's handle.
int ua_monitor_add_sensor (ua_monitor_h monitor, ua_sensor_type_e sensor)
 Adds sensors to UA monitor for which monitoring is to be done. Availability of sensors to be added can be checked using ua_monitor_is_sensor_available().
int ua_monitor_remove_sensor (ua_monitor_h monitor, ua_sensor_type_e sensor)
 Removes sensors from UA monitor.
int ua_monitor_foreach_sensor (ua_monitor_h monitor, ua_monitor_sensor_cb foreach_cb, void *user_data)
 Retrieves all sensors present in UA monitor.
int ua_monitor_is_sensor_available (ua_sensor_type_e sensor, bool *available)
 Checks if sensor is available or not.
int ua_monitor_set_sensor_status_changed_cb (ua_monitor_h monitor, ua_sensor_status_changed_cb callback, void *user_data)
 Sets sensor status changed callback. Callback to be invoked when sensor status changes from 'PRESENCE' to 'ABSENCE' or vice-versa.
int ua_monitor_unset_sensor_status_changed_cb (ua_monitor_h monitor)
 Unsets sensor status changed callback.
int ua_monitor_start_scan (ua_monitor_h monitor, int scan_time_multiplier, ua_scan_completed_cb callback, void *user_data)
 Starts scan of registered devices.
int ua_monitor_stop_scan (ua_monitor_h monitor)
 Stops ua_monitor_start_scan().
int ua_monitor_start_presence_detection (ua_monitor_h monitor, ua_service_h service, ua_detection_mode_e mode, ua_presence_detected_cb callback, void *user_data)
 Starts user presence detection.
int ua_monitor_stop_presence_detection (ua_monitor_h monitor)
 Stops user presence detection.
int ua_monitor_start_absence_detection (ua_monitor_h monitor, ua_service_h service, ua_detection_mode_e mode, ua_absence_detected_cb callback, void *user_data)
 Starts user absence detection.
int ua_monitor_stop_absence_detection (ua_monitor_h monitor)
 Stops user absence detection.
int ua_monitor_set_location_period (ua_monitor_h monitor, unsigned int location_period)
 Sets the location callback period in milli-seconds. If location period is not set, it will be automatically set to UA_LOCATION_PERIOD_DEFAULT.
int ua_monitor_start_location_detection (ua_monitor_h monitor, ua_service_h service, ua_location_detected_cb callback, void *user_data)
 Starts user location detection.
int ua_monitor_stop_location_detection (ua_monitor_h monitor)
 Stops user location detection.
int ua_user_create (const char *account, ua_user_h *user)
 Creates the user handle.
int ua_user_destroy (ua_user_h user)
 Destroys the user handle.
int ua_user_add (ua_user_h user)
 Adds the user. Added user is stored in the database and is also available after the application restarts.
int ua_user_remove (ua_user_h user)
 Removes the user.
int ua_user_get_account (ua_user_h user, char **account)
 Gets account info for user handle.
int ua_user_add_device (ua_user_h user, ua_device_h device, ua_user_device_added_cb callback, void *user_data)
 Adds device for a user. This information is stored in database and is also available after the application restarts.
int ua_user_remove_device (ua_user_h user, ua_device_h device)
 Removes the device handle for a user handle.
int ua_user_foreach_devices (ua_user_h user, ua_registered_device_cb foreach_cb, void *user_data)
 Retrieves the device handle of all the registered devices for a specific user.
int ua_service_create (const char *name, ua_service_h *service)
 Creates the service handle.
int ua_service_destroy (ua_service_h service)
 Destroys the service handle.
int ua_service_add (ua_service_h service)
 Adds the service. Added service is stored in database and is also available after the application restarts.
int ua_service_update (ua_service_h service)
 Updates the properties for the added service. To update a property of a service its respective setter functions should be called and then followed by the call of ua_service_update().
int ua_service_remove (ua_service_h service)
 Removes the service.
int ua_service_get_name (ua_service_h service, char **name)
 Gets name info for service handle.
int ua_service_set_detection_threshold (ua_service_h service, unsigned int presence_threshold, unsigned int absence_threshold)
 Sets detection threshold for service handle. If the service has already been added, this call should be followed by the call of ua_service_update() to reflect the modifications.
int ua_service_get_detection_threshold (ua_service_h service, unsigned int *presence_threshold, unsigned int *absence_threshold)
 Gets detection threshold for service handle.
int ua_service_get_user_by_account (ua_service_h service, const char *account, ua_user_h *user)
 Sets name info for service handle.
int ua_service_add_user (ua_service_h service, ua_user_h user)
 Adds a user for a specific service.
int ua_service_remove_user (ua_service_h service, ua_user_h user)
 Removes the user for the specific service handle.
int ua_service_foreach_users (ua_service_h service, ua_service_user_cb foreach_cb, void *user_data)
 Triggers callback for every user of a specific service.
int ua_device_create (ua_mac_type_e mac_type, const char *mac_address, const char *device_id, ua_device_h *device)
 Creates the device handle.
int ua_device_destroy (ua_device_h device)
 Destroys the device handle.
int ua_device_get_mac_type (ua_device_h device, ua_mac_type_e *mac_type)
 Gets device type info from the device.
int ua_device_set_os_info (ua_device_h device, ua_os_type_e os)
 Sets device's operating system info. If the device has already been added, this call should be followed by the call of ua_device_update() to reflect the modifications.
int ua_device_get_os_info (ua_device_h device, ua_os_type_e *os_info)
 Gets device's operating system info.
int ua_device_get_mac_address (ua_device_h device, char **mac_address)
 Gets device's MAC address.
int ua_device_get_device_id (ua_device_h device, char **device_id)
 Gets device ID of device, which was set while creating the device handle.
int ua_device_set_wifi_bssid (ua_device_h device, const char *bssid)
 Sets device's Wi-Fi BSSID. If the device has already been added, this call should be followed by the call of ua_device_update() to reflect the modifications.
int ua_device_get_wifi_bssid (ua_device_h device, char **bssid)
 Gets device's Wi-Fi BSSID.
int ua_device_set_wifi_ipv4_address (ua_device_h device, const char *ipv4_address)
 Sets device's Wi-Fi IPv4 address. If the device has already been added, this call should be followed by the call of ua_device_update() to reflect the modifications.
int ua_device_get_wifi_ipv4_address (ua_device_h device, char **ipv4_address)
 Gets device's Wi-Fi IPv4 address.
int ua_device_get_last_presence (ua_device_h device, unsigned long long *last_seen)
 Gets last presence time for device handle.
int ua_device_get_pairing_required (ua_device_h device, bool *pairing_required)
 Gets whether pairing is required for the user device.
int ua_device_update (ua_device_h device)
 Updates the properties for the added device. To update a property of a device its respective setter functions should be called and then followed by the call of ua_device_update().
int ua_device_get_by_mac_address (const char *mac, ua_device_h *device)
 Gets device handle by MAC address.
int ua_device_get_by_device_id (const char *device_id, ua_mac_type_e mac_type, ua_device_h *device)
 Gets device handle by device ID.
int ua_sensor_get_status (ua_sensor_h sensor, ua_sensor_report_e *report)
 Gets sensor's status report.
int ua_sensor_get_timestamp (ua_sensor_h sensor, unsigned long long *timestamp)
 Gets sensor's timestamp.
int ua_sensor_get_type (ua_sensor_h sensor, ua_sensor_type_e *type)
 Gets sensor's type.
int ua_location_get_distance (ua_location_h location, int *distance)
 Gets the distance for the location handle.
int ua_location_get_position (ua_location_h location, int *x, int *y, int *z)
 Gets the position for the location handle.

Typedefs

typedef void * ua_sensor_h
 The handle of sensor information.
typedef void * ua_monitor_h
 The handle of user presence/absence monitor.
typedef void * ua_user_h
 The handle of user information.
typedef void * ua_service_h
 The handle of service information.
typedef void * ua_device_h
 The handle of device information.
typedef void * ua_location_h
 The handle of location information.
typedef void(* ua_sensor_status_changed_cb )(ua_monitor_h monitor, ua_sensor_h sensor, ua_sensor_type_e sensor_type, ua_sensor_report_e report, void *user_data)
 Callback to be invoked if a sensor status changed (presence <-> absence) immediately during detection operation.
typedef bool(* ua_monitor_sensor_cb )(ua_sensor_type_e sensor_type, void *user_data)
 Callback to get all sensors for a handle.
typedef void(* ua_scan_completed_cb )(ua_active_scan_type_e type, ua_monitor_h monitor, ua_device_h device, void *user_data)
 Callback to be invoked on completion scan for each device one by one.
typedef void(* ua_presence_detected_cb )(ua_error_e result, ua_monitor_h monitor, ua_sensor_type_e sensor_type, ua_service_h service, ua_device_h device, ua_sensor_h sensor, void *user_data)
 Callback to be invoked on detection of user presence.
typedef void(* ua_absence_detected_cb )(ua_error_e result, ua_monitor_h monitor, ua_service_h service, ua_sensor_type_e sensor_type, ua_sensor_h sensor, void *user_data)
 Callback to be invoked on detection of user absence.
typedef bool(* ua_registered_device_cb )(ua_device_h device, void *user_data)
 Callback to get all registered devices one by one.
typedef bool(* ua_service_cb )(ua_service_h service, void *user_data)
 Callback to get all service handles.
typedef bool(* ua_service_user_cb )(ua_service_h service, ua_user_h user, void *user_data)
 Callback to get the user handle added to the service.
typedef void(* ua_user_device_added_cb )(ua_error_e result, ua_device_h device, void *user_data)
 Callback to be invoked when adding a new device to UA is finished.
typedef void(* ua_location_detected_cb )(ua_error_e result, ua_monitor_h monitor, ua_service_h service, ua_sensor_type_e sensor_type, ua_sensor_h sensor, ua_device_h device, ua_user_h user, ua_location_h location, void *user_data)
 Callback to be invoked on detection of user and device location. It is invoked once for each user/device in location callback. Callback period can be set by ua_monitor_set_location_period().

Defines

#define UA_MAC_ADDRESS_STRING_LEN   18
 Max. MAC address length.
#define UA_IPV4_ADDRESS_STRING_LEN   16
 Max. IPv4 address length.
#define UA_IP_ADDRESS_MAX_STRING_LEN   50
 Max. IP address length (e.g. IPv6).
#define UA_MOBILE_ID_STRING_LEN   50
 Max. device ID length (e.g. UUID).
#define UA_USER_NAME_MAX_STRING_LEN   50
 Max. user name length.
#define UA_USER_ACCOUNT_MAX_STRING_LEN   70
 Max. user account length.
#define UA_SCAN_TIME_MULTIPLIER   10
 Device scan time multiplier.
#define UA_MAX_SERVICE_LEN   50
 Max. service name length.
#define UA_DETECTION_WINDOW_STEP   5
 Window step multiplier.
#define UA_DETECTION_CYCLE_STEP   60
 Detection cycle multiplier.
#define UA_LOCATION_PERIOD_DEFAULT   1000
 Default location callback period (in msec).
#define UA_SENSOR_WIFI_LOCATION   0x00000040
 Wifi location sensor.
#define UA_MAC_TYPE_WIFI_LOCATION   0x10
 Wifi location mac type.
#define UA_SENSOR_UWB   0x00000080
 UWB sensor.
#define UA_MAC_TYPE_UWB   0x20
 UWB mac type.

Define Documentation

#define UA_DETECTION_CYCLE_STEP   60

Detection cycle multiplier.

Detection cycle step is 60 seconds.

Since :
6.5
#define UA_DETECTION_WINDOW_STEP   5

Window step multiplier.

Detection window step is 5 seconds.

Since :
6.5

Max. IP address length (e.g. IPv6).

Since :
6.5
#define UA_IPV4_ADDRESS_STRING_LEN   16

Max. IPv4 address length.

Since :
6.5
#define UA_LOCATION_PERIOD_DEFAULT   1000

Default location callback period (in msec).

Since :
6.5
#define UA_MAC_ADDRESS_STRING_LEN   18

Max. MAC address length.

Since :
6.5
#define UA_MAC_TYPE_UWB   0x20

UWB mac type.

Since :
6.5
#define UA_MAC_TYPE_WIFI_LOCATION   0x10

Wifi location mac type.

Since :
6.5
#define UA_MAX_SERVICE_LEN   50

Max. service name length.

Since :
6.5
#define UA_MOBILE_ID_STRING_LEN   50

Max. device ID length (e.g. UUID).

Since :
6.5
#define UA_SCAN_TIME_MULTIPLIER   10

Device scan time multiplier.

Since :
6.5
#define UA_SENSOR_UWB   0x00000080

UWB sensor.

Since :
6.5
#define UA_SENSOR_WIFI_LOCATION   0x00000040

Wifi location sensor.

Since :
6.5

Max. user account length.

Since :
6.5
#define UA_USER_NAME_MAX_STRING_LEN   50

Max. user name length.

Since :
6.5

Typedef Documentation

typedef void(* ua_absence_detected_cb)(ua_error_e result, ua_monitor_h monitor, ua_service_h service, ua_sensor_type_e sensor_type, ua_sensor_h sensor, void *user_data)

Callback to be invoked on detection of user absence.

Following error codes can be delivered: UA_ERROR_NONE Successful. UA_ERROR_OPERATION_FAILED Operation failed

Since :
6.5
Remarks:
The monitor handle should not be released.
The monitor handle can be used only in the callback.
The sensor handle should not be released.
The sensor handle can be used only in the callback.
The service handle should not be released.
The service handle can be used only in the callback.
Parameters:
[in]resultThe result error code of the requested operation. result is UA_ERROR_NONE on success, otherwise appropriate error value.
[in]monitorThe monitor handle with which absence detection start was invoked.
[in]serviceThe service handle with which absence detection start was invoked.
[in]sensor_typeSensor type by which absence was detected.
[in]sensorThe sensor handle for the detected sensor.
[in]user_dataThe user data passed in ua_monitor_start_absence_detection()
See also:
ua_monitor_start_absence_detection()
typedef void* ua_device_h

The handle of device information.

Since :
6.5
typedef void(* ua_location_detected_cb)(ua_error_e result, ua_monitor_h monitor, ua_service_h service, ua_sensor_type_e sensor_type, ua_sensor_h sensor, ua_device_h device, ua_user_h user, ua_location_h location, void *user_data)

Callback to be invoked on detection of user and device location. It is invoked once for each user/device in location callback. Callback period can be set by ua_monitor_set_location_period().

Following error codes can be delivered: UA_ERROR_NONE Successful. UA_ERROR_OPERATION_FAILED Operation failed

Since :
6.5
Remarks:
The monitor handle should not be released and can be used only in the callback.
The service handle should not be released and can be used only in the callback.
The sensor handle should not be released and can be used only in the callback.
The device handle should not be released and can be used only in the callback.
The user handle should not be released and can be used only in the callback.
The location handle should not be released and can be used only in the callback.
Parameters:
[in]resultThe result error code of the requested operation. result is UA_ERROR_NONE on success, otherwise appropriate error value.
[in]monitorThe monitor handle
[in]serviceThe service handle with which location detection start was invoked.
[in]sensor_typeSensor type
[in]sensorThe handle of the sensor which reported user/device location.
[in]deviceThe device handle on which sensor is detected.
[in]userThe user handle on which sensor is detected.
[in]locationThe location handle.
[in]user_dataThe user data passed in ua_monitor_start_location_detection()
See also:
ua_monitor_set_location_period()
ua_monitor_start_location_detection()
typedef void* ua_location_h

The handle of location information.

Since :
6.5
typedef void* ua_monitor_h

The handle of user presence/absence monitor.

Since :
6.5
typedef bool(* ua_monitor_sensor_cb)(ua_sensor_type_e sensor_type, void *user_data)

Callback to get all sensors for a handle.

Since :
6.5
Parameters:
[in]sensor_typeSensor type which is present in UA monitor.
[in]user_dataUser data passed in ua_monitor_foreach_sensor().
Returns:
true to continue with the next iteration of the loop, false to break out of the loop and False to break out of the loop
See also:
ua_monitor_foreach_sensor()
typedef void(* ua_presence_detected_cb)(ua_error_e result, ua_monitor_h monitor, ua_sensor_type_e sensor_type, ua_service_h service, ua_device_h device, ua_sensor_h sensor, void *user_data)

Callback to be invoked on detection of user presence.

Following error codes can be delivered: UA_ERROR_NONE Successful. UA_ERROR_OPERATION_FAILED Operation failed

Since :
6.5
Remarks:
The monitor handle should not be released.
The monitor handle can be used only in the callback.
The device handle should not be released.
The device handle can be used only in the callback.
The sensor handle should not be released.
The sensor handle can be used only in the callback.
The service handle should not be released.
The service handle can be used only in the callback.
Parameters:
[in]resultThe result error code of the requested operation. result is UA_ERROR_NONE on success, otherwise appropriate error value.
[in]monitorThe monitor handle
[in]sensor_typeSensor type, In case monitor has more than one sensor and detection mode is not UA_DETECT_MODE_ANY_SENSOR, sensor will be set to last sensor which reported user presence before invoking callback.
[in]serviceThe service handle with which presence detection start was invoked.
[in]deviceThe first device handle on which sensor is detected.
[in]sensorThe handle of the sensor which reported user/device presence.
[in]user_dataThe user data passed in ua_monitor_start_presence_detection()
See also:
ua_monitor_start_presence_detection()
typedef bool(* ua_registered_device_cb)(ua_device_h device, void *user_data)

Callback to get all registered devices one by one.

Since :
6.5
Remarks:
The device handle should not be released.
The device handle can be used only in the callback.
Parameters:
[in]deviceThe device handle.
[in]user_dataUser data passed in ua_user_foreach_devices().
Returns:
true to continue with the next iteration of the loop, false to break out of the loop
See also:
ua_user_foreach_devices()
typedef void(* ua_scan_completed_cb)(ua_active_scan_type_e type, ua_monitor_h monitor, ua_device_h device, void *user_data)

Callback to be invoked on completion scan for each device one by one.

Since :
6.5
Remarks:
The monitor handle should not be released.
The monitor handle can be used only in the callback.
The device handle should not be released.
The device handle can be used only in the callback.
Parameters:
[in]typeTo indicate if active scan type is set to device being found or scan complete.
[in]monitorThe monitor handle
[in]deviceThe device handle to detected device's information. When scan is complete, it is set to NULL.
[in]user_dataThe user data passed in ua_monitor_start_scan()
See also:
ua_monitor_start_scan()
typedef void* ua_sensor_h

The handle of sensor information.

Since :
6.5
typedef void(* ua_sensor_status_changed_cb)(ua_monitor_h monitor, ua_sensor_h sensor, ua_sensor_type_e sensor_type, ua_sensor_report_e report, void *user_data)

Callback to be invoked if a sensor status changed (presence <-> absence) immediately during detection operation.

Since :
6.5
Remarks:
The monitor handle should not be released.
The monitor handle can be used only in the callback.
The sensor handle should not be released.
The sensor handle can be used only in the callback.
Parameters:
[in]monitorThe monitor handle for which sensor type was added.
[in]sensorThe list of sensor handles on which user is not detected.
[in]sensor_typeThe type of sensor detected.
[in]reportThe status report of sensor detected.
[in]user_dataThe user data passed in ua_monitor_set_sensor_status_changed_cb().
typedef bool(* ua_service_cb)(ua_service_h service, void *user_data)

Callback to get all service handles.

Since :
6.5
Remarks:
The service handle should not be released.
The service handle can be used only in the callback.
Parameters:
[in]serviceThe service handle.
[in]user_dataUser data passed in ua_foreach_service().
Returns:
true to continue with the next iteration of the loop, false to break out of the loop
See also:
ua_foreach_service()
typedef void* ua_service_h

The handle of service information.

Since :
6.5
typedef bool(* ua_service_user_cb)(ua_service_h service, ua_user_h user, void *user_data)

Callback to get the user handle added to the service.

Since :
6.5
Remarks:
The service handle should not be released.
The service handle can be used only in the callback.
The user handle should not be released.
The user handle can be used only in the callback.
Parameters:
[in]serviceThe service handle.
[in]userThe user handle.
[in]user_dataUser data passed in ua_service_foreach_users().
Returns:
true to continue with the next iteration of the loop, false to break out of the loop
See also:
ua_service_foreach_users()
typedef void(* ua_user_device_added_cb)(ua_error_e result, ua_device_h device, void *user_data)

Callback to be invoked when adding a new device to UA is finished.

Following error codes can be delivered: UA_ERROR_NONE Successful. UA_ERROR_OPERATION_FAILED Operation failed

Since :
6.5
Remarks:
The device handle should not be released.
The device handle can be used only in the callback.
Parameters:
[in]resultThe result error code of the requested operation. result is UA_ERROR_NONE on success, otherwise appropriate error value.
[in]deviceThe added device's handle
[in]user_dataThe user data passed in ua_user_add_device()
See also:
ua_user_add_device()
typedef void* ua_user_h

The handle of user information.

Since :
6.5

Enumeration Type Documentation

Enumeration for active scan type.

Since :
6.5
Enumerator:
UA_ACTIVE_SCAN_TYPE_DEVICE_FOUND 

Device found

UA_ACTIVE_SCAN_TYPE_COMPLETED 

SCAN Completed

Enumeration for UA framework user detection modes.

Since :
6.5
Enumerator:
UA_DETECT_MODE_ALL_SENSORS 

Detection mode all

UA_DETECT_MODE_ANY_SENSOR 

Detection mode any

UA_DETECT_MODE_INVALID 

<Invalid detection mode

enum ua_error_e

Enumeration for UA framework error codes.

Since :
6.5
Enumerator:
UA_ERROR_NONE 

Successful

UA_ERROR_NOT_PERMITTED 

Operation not permitted

UA_ERROR_INVALID_PARAMETER 

Invalid parameter

UA_ERROR_OUT_OF_MEMORY 

Out of memory

UA_ERROR_PERMISSION_DENIED 

Permission denied

UA_ERROR_RESOURCE_BUSY 

Device or resource busy

UA_ERROR_TIMED_OUT 

Timeout error

UA_ERROR_CANCELED 

Operation canceled

UA_ERROR_NOW_IN_PROGRESS 

Operation now in progress

UA_ERROR_NOT_SUPPORTED 

Not Supported

UA_ERROR_NO_DATA 

No data available

UA_ERROR_NOT_INITIALIZED 

Not initialized

UA_ERROR_NOT_IN_PROGRESS 

Operation Not in progress

UA_ERROR_ALREADY_DONE 

Operation already done

UA_ERROR_OPERATION_FAILED 

Operation Failed

UA_ERROR_NOT_READY 

Resource not ready

UA_ERROR_NOT_ENABLED 

Not enabled

UA_ERROR_NOT_FOUND 

Not found

UA_ERROR_ALREADY_REGISTERED 

Already registered

UA_ERROR_DB_FAILED 

DB operation failed

UA_ERROR_NOT_REGISTERED 

Not registered

Enumeration for User device MAC address types.

Since :
6.5
Enumerator:
UA_MAC_TYPE_NONE 

None

UA_MAC_TYPE_BT 

BT MAC

UA_MAC_TYPE_BLE 

BLE MAC

UA_MAC_TYPE_WIFI 

Wi-Fi station mode MAC

UA_MAC_TYPE_P2P 

Wi-Fi P2P mode MAC

Enumeration for User device Operating Systems.

Since :
6.5
Enumerator:
UA_OS_TYPE_NOT_DEFINED 

OS not defined

UA_OS_TYPE_TIZEN 

Tizen

UA_OS_TYPE_ANDROID 

Android

UA_OS_TYPE_IOS 

iOS

Enumeration for sensor status report.

Since :
6.5
Enumerator:
UA_SENSOR_REPORT_PRESENCE 

Sensor reports PRESENCE status

UA_SENSOR_REPORT_ABSENCE 

Sensor reports ABSENCE status

Enumeration for UA framework supported sensors.

Since :
6.5
Enumerator:
UA_SENSOR_BT 

BT Sensor

UA_SENSOR_BLE 

BLE Sensor

UA_SENSOR_WIFI 

Wi-Fi Sensor

UA_SENSOR_MOTION 

Motion Sensor

UA_SENSOR_LIGHT 

Light Sensor

UA_SENSOR_AUDIO 

Audio Sensor

UA_SENSOR_ALL 

All sensors


Function Documentation

int ua_deinitialize ( void  )

De-initializes the user awareness framework.

Since :
6.5
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_NOT_INITIALIZEDNot initialized yet
UA_ERROR_ALREADY_DONEAlready initialized
See also:
ua_initialize()
int ua_device_create ( ua_mac_type_e  mac_type,
const char *  mac_address,
const char *  device_id,
ua_device_h device 
)

Creates the device handle.

Since :
6.5
Remarks:
The device handle should be destroyed using ua_user_destroy().
Parameters:
[in]mac_typeThe MAC address type of the device
[in]mac_addressThe device's MAC address.
[in]device_idThe device ID.
[out]deviceThe device handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_device_destroy()
int ua_device_destroy ( ua_device_h  device)

Destroys the device handle.

Since :
6.5
Remarks:
Device context will be removed and all allocated memory (if any) will be released.
Parameters:
[in]deviceThe device handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_device_create()
int ua_device_get_by_device_id ( const char *  device_id,
ua_mac_type_e  mac_type,
ua_device_h device 
)

Gets device handle by device ID.

Since :
6.5
Remarks:
The device handle should not be released.
The device handle is available until device is removed and released by application using ua_user_remove_device() and ua_device_destroy()
Parameters:
[in]device_idThe device ID
[in]mac_typeThe device's MAC type
[out]deviceThe device handle.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_device_get_by_mac_address ( const char *  mac,
ua_device_h device 
)

Gets device handle by MAC address.

Since :
6.5
Remarks:
The device handle should not be released.
The device handle is available until device is removed and released by application using ua_user_remove_device() and ua_device_destroy()
Parameters:
[in]macThe device's MAC address
[out]deviceThe device handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_device_get_device_id ( ua_device_h  device,
char **  device_id 
)

Gets device ID of device, which was set while creating the device handle.

Since :
6.5
Remarks:
You must release device_id using g_free().
Parameters:
[in]deviceThe device handle
[out]device_idThe device ID.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_INVALID_PARAMETERInvalid parameter
int ua_device_get_last_presence ( ua_device_h  device,
unsigned long long *  last_seen 
)

Gets last presence time for device handle.

Since :
6.5
Parameters:
[in]deviceThe device handle
[out]last_seenThe last presence monotonic timestamp for UA device (in msec)
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_INVALID_PARAMETERInvalid parameter
int ua_device_get_mac_address ( ua_device_h  device,
char **  mac_address 
)

Gets device's MAC address.

Since :
6.5
Remarks:
You must release mac_address using g_free().
Parameters:
[in]deviceThe device handle
[out]mac_addressThe device's MAC address.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_INVALID_PARAMETERInvalid parameter
int ua_device_get_mac_type ( ua_device_h  device,
ua_mac_type_e mac_type 
)

Gets device type info from the device.

Since :
6.5
Parameters:
[in]deviceThe device handle
[out]mac_typeThe MAC address type of the device
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_INVALID_PARAMETERInvalid parameter
int ua_device_get_os_info ( ua_device_h  device,
ua_os_type_e os_info 
)

Gets device's operating system info.

Since :
6.5
Parameters:
[in]deviceThe device handle
[out]os_infoDevice's operating system info.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_INVALID_PARAMETERInvalid parameter
See also:
ua_device_set_os_info()
int ua_device_get_pairing_required ( ua_device_h  device,
bool *  pairing_required 
)

Gets whether pairing is required for the user device.

Since :
6.5
Parameters:
[in]deviceThe device handle
[out]pairing_requiredTRUE if pairing is required, FALSE otherwise.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_device_create()
int ua_device_get_wifi_bssid ( ua_device_h  device,
char **  bssid 
)

Gets device's Wi-Fi BSSID.

Since :
6.5
Remarks:
You must release bssid using g_free().
Parameters:
[in]deviceThe device handle
[out]bssidThe device's Wi-Fi BSSID.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_INVALID_PARAMETERInvalid parameter
See also:
ua_device_set_wifi_bssid()
int ua_device_get_wifi_ipv4_address ( ua_device_h  device,
char **  ipv4_address 
)

Gets device's Wi-Fi IPv4 address.

Since :
6.5
Remarks:
You must release ipv4_address using g_free().
Parameters:
[in]deviceThe device handle
[out]ipv4_addressThe device's Wi-Fi IPv4 address.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_INVALID_PARAMETERInvalid parameter
See also:
ua_device_set_wifi_ipv4_address()

Sets device's operating system info. If the device has already been added, this call should be followed by the call of ua_device_update() to reflect the modifications.

Since :
6.5
Parameters:
[in]deviceThe device handle
[in]osThe device's operating system.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_device_get_os_info()
int ua_device_set_wifi_bssid ( ua_device_h  device,
const char *  bssid 
)

Sets device's Wi-Fi BSSID. If the device has already been added, this call should be followed by the call of ua_device_update() to reflect the modifications.

Since :
6.5
Parameters:
[in]deviceThe device handle
[in]bssidThe device's Wi-Fi BSSID.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_device_get_wifi_bssid()
int ua_device_set_wifi_ipv4_address ( ua_device_h  device,
const char *  ipv4_address 
)

Sets device's Wi-Fi IPv4 address. If the device has already been added, this call should be followed by the call of ua_device_update() to reflect the modifications.

Since :
6.5
Parameters:
[in]deviceThe device handle
[in]ipv4_addressThe device's wifi IPv4 address.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_device_get_wifi_ipv4_address()
int ua_device_update ( ua_device_h  device)

Updates the properties for the added device. To update a property of a device its respective setter functions should be called and then followed by the call of ua_device_update().

Since :
6.5
Remarks:
If you want to update BLE device, you should add privilege http://tizen.org/privilege/bluetooth. if you want to update Wi-Fi device, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]deviceThe device handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_device_set_os_info()
ua_device_set_wifi_ipv4_address()
int ua_foreach_service ( ua_service_cb  foreach_cb,
void *  user_data 
)

Retrieves handles of all added services.

Since :
6.5
Parameters:
[in]foreach_cbCallback function to be invoked with each service handle.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_cb()

Gets default service handle.

Since :
6.5
Remarks:
The service handle is managed by the platform and will be released when ua_deinitialize() is called.
Parameters:
[out]serviceThe service handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_get_name()
ua_service_create()
int ua_get_service_by_name ( const char *  name,
ua_service_h service 
)

Gets service handle by service name for added service.

Since :
6.5
Remarks:
The service handle should be destroyed by using ua_service_destroy().
Parameters:
[in]nameThe service name information
[out]serviceThe service handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter or if service with such name does not exist.
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_create()
int ua_initialize ( void  )

Initializes the user awareness framework.

Since :
6.5
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_ALREADY_DONEAlready initialized
See also:
ua_deinitialize()
int ua_location_get_distance ( ua_location_h  location,
int *  distance 
)

Gets the distance for the location handle.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]locationThe location handle for location information.
[out]distancedistance of the detected device and user.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_location_get_position ( ua_location_h  location,
int *  x,
int *  y,
int *  z 
)

Gets the position for the location handle.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]locationThe location handle for location information.
[out]xx-coordinate of the location.
[out]yy-coordinate of the location.
[out]zz-coordinate of the location.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_monitor_add_sensor ( ua_monitor_h  monitor,
ua_sensor_type_e  sensor 
)

Adds sensors to UA monitor for which monitoring is to be done. Availability of sensors to be added can be checked using ua_monitor_is_sensor_available().

Since :
6.5
Remarks:
If you want to add the BLE sensor, you should add privilege http://tizen.org/privilege/bluetooth. if you want to add the Wi-Fi sensor, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]monitorThe monitor handle
[in]sensorThe sensor to be added to monitor
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter or sensor not available to add
UA_ERROR_NOT_PERMITTEDOperation not permitted
UA_ERROR_ALREADY_DONEAlready done
UA_ERROR_NOT_READYResource not ready
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_remove_sensor()
ua_monitor_foreach_sensor()
int ua_monitor_create ( ua_monitor_h monitor)

Creates the ua monitor's handle.

Since :
6.5
Remarks:
The monitor handle should be destroyed by using ua_monitor_destroy().
Parameters:
[out]monitorThe monitor handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_destroy()
int ua_monitor_destroy ( ua_monitor_h  monitor)

Destroys the ua monitor's handle.

Since :
6.5
Parameters:
[in]monitorThe monitor handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_create()
int ua_monitor_foreach_sensor ( ua_monitor_h  monitor,
ua_monitor_sensor_cb  foreach_cb,
void *  user_data 
)

Retrieves all sensors present in UA monitor.

Since :
6.5
Parameters:
[in]monitorThe monitor handle
[in]foreach_cbCallback function to be invoked foreach sensor present in monitor handle.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_add_sensor()
ua_monitor_remove_sensor()
int ua_monitor_is_sensor_available ( ua_sensor_type_e  sensor,
bool *  available 
)

Checks if sensor is available or not.

Since :
6.5
Parameters:
[in]sensorThe sensor for which status to be checked.
[out]availableTRUE if sensor is available FALSE otherwise.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet

Removes sensors from UA monitor.

Since :
6.5
Remarks:
If you want to remove the BLE sensor, you should add privilege http://tizen.org/privilege/bluetooth. if you want to remove the Wi-Fi sensor, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]monitorThe monitor handle
[in]sensorSensor to be removed from monitor
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter or sensor not available to remove
UA_ERROR_NOT_PERMITTEDOperation not permitted
UA_ERROR_ALREADY_DONEAlready done
UA_ERROR_NOT_READYResource not ready
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_add_sensor()
ua_monitor_foreach_sensor()
int ua_monitor_set_location_period ( ua_monitor_h  monitor,
unsigned int  location_period 
)

Sets the location callback period in milli-seconds. If location period is not set, it will be automatically set to UA_LOCATION_PERIOD_DEFAULT.

Since :
6.5
Parameters:
[in]monitorThe monitor handle
[in]location_periodlocation period (0 to UINT_MAX)
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_monitor_set_sensor_status_changed_cb ( ua_monitor_h  monitor,
ua_sensor_status_changed_cb  callback,
void *  user_data 
)

Sets sensor status changed callback. Callback to be invoked when sensor status changes from 'PRESENCE' to 'ABSENCE' or vice-versa.

Since :
6.5
Remarks:
Sensor status change will be reported only for environmental sensors (ie. the sensors for which user/device information is not available, For example. Light and Motion Sensors)
Parameters:
[in]monitorThe monitor handle
[in]callbackSensor status changed callback
[in]user_dataThe user data to be passed in sensor state changed callback.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_monitor_start_absence_detection ( ua_monitor_h  monitor,
ua_service_h  service,
ua_detection_mode_e  mode,
ua_absence_detected_cb  callback,
void *  user_data 
)

Starts user absence detection.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
If you want to start BLE absence detection, you should add privilege http://tizen.org/privilege/bluetooth. if you want to start Wi-Fi absence detection, you should add privilege http://tizen.org/privilege/network.get.
This function is not specific for any particular user's absence detection. Therefore, the callback will be invoked only when no user is detected by sensors.
Parameters:
[in]monitorThe monitor handle
[in]serviceThe service handle. If service is NULL then monitor will start for default service.
[in]modeUser detection mode.
UA_DETECT_MODE_ALL_SENSORS : Detection callback will be invoked only after no user is detected by all sensors added to monitor.
UA_DETECT_MODE_ANY_SENSOR : Detection callback will be invoked as soon as no user is detected by any one of the sensors.
[in]callbackCallback to be invoked after absence detection.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOW_IN_PROGRESSOperation now in progress
UA_ERROR_NO_DATANo sensor available
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_absence_detected_cb()
ua_monitor_stop_absence_detection()
int ua_monitor_start_location_detection ( ua_monitor_h  monitor,
ua_service_h  service,
ua_location_detected_cb  callback,
void *  user_data 
)

Starts user location detection.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
If you want to start BLE location detection, you should add privilege http://tizen.org/privilege/bluetooth. If you want to start Wi-Fi location detection, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]monitorThe monitor handle
[in]serviceThe service handle. If service is NULL then monitor will start for default service.
[in]callbackCallback to be invoked after device location detection.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOW_IN_PROGRESSOperation now in progress
UA_ERROR_NO_DATANo sensor available
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_location_detected_cb()
ua_monitor_set_location_period()
ua_monitor_stop_location_detection()
int ua_monitor_start_presence_detection ( ua_monitor_h  monitor,
ua_service_h  service,
ua_detection_mode_e  mode,
ua_presence_detected_cb  callback,
void *  user_data 
)

Starts user presence detection.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
If you want to start BLE presence detection, you should add privilege http://tizen.org/privilege/bluetooth. if you want to start Wi-Fi presence detection, you should add privilege http://tizen.org/privilege/network.get.
This function is not specific for any particular user's presence detection. Therefore, the callback will be invoked when any user is detected by sensors.
Parameters:
[in]monitorThe monitor handle
[in]serviceThe service handle. If service is NULL then monitor will start for default service.
[in]modeUser detection mode.
UA_DETECT_MODE_ALL_SENSORS : Detection callback will be invoked only after a user is detected by all sensors added to monitor.
UA_DETECT_MODE_ANY_SENSOR : Detection callback will be invoked as soon as a user is detected by any one of the sensors.
[in]callbackCallback to be invoked after device presence detection.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOW_IN_PROGRESSOperation now in progress
UA_ERROR_NO_DATANo sensor available
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_presence_detected_cb()
ua_monitor_stop_presence_detection()
int ua_monitor_start_scan ( ua_monitor_h  monitor,
int  scan_time_multiplier,
ua_scan_completed_cb  callback,
void *  user_data 
)

Starts scan of registered devices.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
If you want to start BLE scan, you should add privilege http://tizen.org/privilege/bluetooth. if you want to start Wi-Fi scan, you should add privilege http://tizen.org/privilege/network.get.
Only one scan can run at one time.
Parameters:
[in]monitorThe monitor handle
[in]scan_time_multiplierA value which we will multiply by UA_SCAN_TIME_MULTIPLIER. This is maximum time (in seconds) for which scan can run, but scan can complete earlier also.
[in]callbackIt will be called for each scanned device one by one, and on scan completion too.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOW_IN_PROGRESSOperation now in progress
UA_ERROR_NO_DATANo sensor available
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
UA_SCAN_TIME_MULTIPLIER
ua_scan_completed_cb()
ua_monitor_stop_scan()

Stops user absence detection.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
If you want to stop BLE absence detection, you should add privilege http://tizen.org/privilege/bluetooth. if you want to stop Wi-Fi absence detection, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]monitorThe monitor handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_IN_PROGRESSOperation not in progress
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_start_absence_detection()

Stops user location detection.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
If you want to stop BLE location detection, you should add privilege http://tizen.org/privilege/bluetooth. If you want to stop Wi-Fi location detection, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]monitorUA monitor's handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_IN_PROGRESSOperation not in progress
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_start_location_detection()

Stops user presence detection.

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
If you want to stop BLE presence detection, you should add privilege http://tizen.org/privilege/bluetooth. if you want to stop Wi-Fi presence detection, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]monitorUA monitor's handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_IN_PROGRESSOperation not in progress
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_start_presence_detection()

Stops ua_monitor_start_scan().

Since :
6.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
If you want to stop BLE scan, you should add privilege http://tizen.org/privilege/bluetooth. if you want to stop Wi-Fi scan, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]monitorUA monitor's handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_IN_PROGRESSOperation not in progress
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_start_scan()

Unsets sensor status changed callback.

Since :
6.5
Parameters:
[in]monitorThe monitor handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_monitor_set_sensor_status_changed_cb()
int ua_sensor_get_status ( ua_sensor_h  sensor,
ua_sensor_report_e report 
)

Gets sensor's status report.

Since :
6.5
Parameters:
[in]sensorThe sensor handle
[out]reportThe sensor's status report.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_sensor_get_timestamp ( ua_sensor_h  sensor,
unsigned long long *  timestamp 
)

Gets sensor's timestamp.

Since :
6.5
Parameters:
[in]sensorThe sensor handle
[out]timestampThe sensor's timestamp.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_sensor_get_type ( ua_sensor_h  sensor,
ua_sensor_type_e type 
)

Gets sensor's type.

Since :
6.5
Parameters:
[in]sensorThe sensor handle
[out]typeThe sensor's type.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_service_add ( ua_service_h  service)

Adds the service. Added service is stored in database and is also available after the application restarts.

Since :
6.5
Parameters:
[in]serviceThe service handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_remove()
int ua_service_add_user ( ua_service_h  service,
ua_user_h  user 
)

Adds a user for a specific service.

Since :
6.5
Parameters:
[in]serviceThe service handle.
[in]userThe user handle.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_remove_user()
int ua_service_create ( const char *  name,
ua_service_h service 
)

Creates the service handle.

Since :
6.5
Remarks:
The service handle should be destroyed by using ua_service_destroy().
Parameters:
[in]nameThe service name information
[out]serviceThe service handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_destroy()
int ua_service_destroy ( ua_service_h  service)

Destroys the service handle.

Since :
6.5
Remarks:
Service context will be removed and all allocated memory (if any) will be released.
Parameters:
[in]serviceThe service handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_create()
int ua_service_foreach_users ( ua_service_h  service,
ua_service_user_cb  foreach_cb,
void *  user_data 
)

Triggers callback for every user of a specific service.

Since :
6.5
Parameters:
[in]serviceThe service handle.
[in]foreach_cbCallback function to be invoked with user handle.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_user_cb()
int ua_service_get_detection_threshold ( ua_service_h  service,
unsigned int *  presence_threshold,
unsigned int *  absence_threshold 
)

Gets detection threshold for service handle.

Since :
6.5
Parameters:
[in]serviceThe service handle
[out]presence_thresholdThe service presence threshold information (in lux)
[out]absence_thresholdThe service absence threshold information (in lux)
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_set_detection_threshold()
int ua_service_get_name ( ua_service_h  service,
char **  name 
)

Gets name info for service handle.

Since :
6.5
Remarks:
You must release name using g_free().
Parameters:
[in]serviceThe service handle
[out]nameThe service name information
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_create()
int ua_service_get_user_by_account ( ua_service_h  service,
const char *  account,
ua_user_h user 
)

Sets name info for service handle.

Since :
6.5
Remarks:
The user should not be released.
The user is available until user is removed and released by application using ua_user_remove() and ua_user_destroy()
Parameters:
[in]serviceThe service handle
[in]accountThe user account information
[out]userThe user handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_service_remove ( ua_service_h  service)

Removes the service.

Since :
6.5
Parameters:
[in]serviceThe service handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_add()
int ua_service_remove_user ( ua_service_h  service,
ua_user_h  user 
)

Removes the user for the specific service handle.

Since :
6.5
Parameters:
[in]serviceThe service handle.
[in]userThe user handle.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_add_user()
int ua_service_set_detection_threshold ( ua_service_h  service,
unsigned int  presence_threshold,
unsigned int  absence_threshold 
)

Sets detection threshold for service handle. If the service has already been added, this call should be followed by the call of ua_service_update() to reflect the modifications.

Since :
6.5
Parameters:
[in]serviceThe service handle
[in]presence_thresholdThe service presence threshold information (in lux)
[in]absence_thresholdThe service absence threshold information (in lux)
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
int ua_service_update ( ua_service_h  service)

Updates the properties for the added service. To update a property of a service its respective setter functions should be called and then followed by the call of ua_service_update().

Since :
6.5
Parameters:
[in]serviceThe service handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_service_create()
ua_service_remove()
int ua_user_add ( ua_user_h  user)

Adds the user. Added user is stored in the database and is also available after the application restarts.

Since :
6.5
Parameters:
[in]userThe user handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
UA_ERROR_ALREADY_REGISTEREDAlready Registered
See also:
ua_user_remove()
int ua_user_add_device ( ua_user_h  user,
ua_device_h  device,
ua_user_device_added_cb  callback,
void *  user_data 
)

Adds device for a user. This information is stored in database and is also available after the application restarts.

Since :
6.5
Remarks:
If you want to add the BLE device, you should add privilege http://tizen.org/privilege/bluetooth. if you want to add the Wi-Fi device, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]userThe user handle.
[in]deviceThe device handle.
[in]callbackCallback to be invoked after adding the user done.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_user_remove_device()
ua_user_device_added_cb()
int ua_user_create ( const char *  account,
ua_user_h user 
)

Creates the user handle.

Since :
6.5
Remarks:
The user handle should be destroyed by using ua_user_destroy().
Parameters:
[in]accountAccount information. Maximum Account string length allowed is 254.
[out]userThe user handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_user_destroy()
int ua_user_destroy ( ua_user_h  user)

Destroys the user handle.

Since :
6.5
Remarks:
User context will removed and all allocated memory (if any) will be released.
Parameters:
[in]userThe user handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_user_create()
int ua_user_foreach_devices ( ua_user_h  user,
ua_registered_device_cb  foreach_cb,
void *  user_data 
)

Retrieves the device handle of all the registered devices for a specific user.

Since :
6.5
Parameters:
[in]userThe user handle.
[in]foreach_cbCallback function to be invoked with user device handle.
[in]user_dataThe user data to be passed when callback is called.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_registered_device_cb()
int ua_user_get_account ( ua_user_h  user,
char **  account 
)

Gets account info for user handle.

Since :
6.5
Remarks:
You must release account using g_free().
Parameters:
[in]userThe user handle
[out]accountAccount information
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OUT_OF_MEMORYOut of memory
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_user_create()
int ua_user_remove ( ua_user_h  user)

Removes the user.

Since :
6.5
Parameters:
[in]userThe user handle
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_user_add()
int ua_user_remove_device ( ua_user_h  user,
ua_device_h  device 
)

Removes the device handle for a user handle.

Since :
6.5
Remarks:
If you want to remove the BLE device, you should add privilege http://tizen.org/privilege/bluetooth. if you want to remove the Wi-Fi device, you should add privilege http://tizen.org/privilege/network.get.
Parameters:
[in]userThe user handle.
[in]deviceThe device handle.
Returns:
0 on success, otherwise a negative error value
Return values:
UA_ERROR_NONESuccessful
UA_ERROR_NOT_SUPPORTEDNot Supported
UA_ERROR_PERMISSION_DENIEDPermission Denied
UA_ERROR_INVALID_PARAMETERInvalid parameter
UA_ERROR_RESOURCE_BUSYRemove done. but another service uses this device.
UA_ERROR_OPERATION_FAILEDOperation failed
UA_ERROR_NOT_INITIALIZEDNot initialized yet
See also:
ua_user_add_device()