Tizen Native API
8.0
|
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
#define UA_IP_ADDRESS_MAX_STRING_LEN 50 |
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
#define UA_USER_ACCOUNT_MAX_STRING_LEN 70 |
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] result The result error code of the requested operation. result is UA_ERROR_NONE on success, otherwise appropriate error value. [in] monitor The monitor handle with which absence detection start was invoked. [in] service The service handle with which absence detection start was invoked. [in] sensor_type Sensor type by which absence was detected. [in] sensor The sensor handle for the detected sensor. [in] user_data The 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] result The result error code of the requested operation. result is UA_ERROR_NONE on success, otherwise appropriate error value. [in] monitor The monitor handle [in] service The service handle with which location detection start was invoked. [in] sensor_type Sensor type [in] sensor The handle of the sensor which reported user/device location. [in] device The device handle on which sensor is detected. [in] user The user handle on which sensor is detected. [in] location The location handle. [in] user_data The user data passed in 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_type Sensor type which is present in UA monitor. [in] user_data User 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] result The result error code of the requested operation. result is UA_ERROR_NONE on success, otherwise appropriate error value. [in] monitor The monitor handle [in] sensor_type Sensor 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] service The service handle with which presence detection start was invoked. [in] device The first device handle on which sensor is detected. [in] sensor The handle of the sensor which reported user/device presence. [in] user_data The user data passed in 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] device The device handle. [in] user_data User 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] type To indicate if active scan type is set to device being found or scan complete. [in] monitor The monitor handle [in] device The device handle to detected device's information. When scan is complete, it is set to NULL. [in] user_data The 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] monitor The monitor handle for which sensor type was added. [in] sensor The list of sensor handles on which user is not detected. [in] sensor_type The type of sensor detected. [in] report The status report of sensor detected. [in] user_data The 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] service The service handle. [in] user_data User 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] service The service handle. [in] user The user handle. [in] user_data User 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] result The result error code of the requested operation. result is UA_ERROR_NONE on success, otherwise appropriate error value. [in] device The added device's handle [in] user_data The 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
enum ua_detection_mode_e |
enum ua_error_e |
Enumeration for UA framework error codes.
- Since :
- 6.5
- Enumerator:
enum ua_mac_type_e |
enum ua_os_type_e |
enum ua_sensor_report_e |
enum ua_sensor_type_e |
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_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_NOT_INITIALIZED Not initialized yet UA_ERROR_ALREADY_DONE Already 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_type The MAC address type of the device [in] mac_address The device's MAC address. [in] device_id The device ID. [out] device The device handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not 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] device The device handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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_id The device ID [in] mac_type The device's MAC type [out] device The device handle.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not 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] mac The device's MAC address [out] device The device handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not 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] device The device handle [out] device_id The device ID.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_INVALID_PARAMETER Invalid 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] device The device handle [out] last_seen The last presence monotonic timestamp for UA device (in msec)
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_INVALID_PARAMETER Invalid 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] device The device handle [out] mac_address The device's MAC address.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_INVALID_PARAMETER Invalid 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] device The device handle [out] mac_type The MAC address type of the device
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_INVALID_PARAMETER Invalid 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] device The device handle [out] os_info Device's operating system info.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_INVALID_PARAMETER Invalid 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] device The device handle [out] pairing_required TRUE if pairing is required, FALSE otherwise.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not 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] device The device handle [out] bssid The device's Wi-Fi BSSID.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_INVALID_PARAMETER Invalid 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] device The device handle [out] ipv4_address The device's Wi-Fi IPv4 address.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- ua_device_set_wifi_ipv4_address()
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.
- Since :
- 6.5
- Parameters:
-
[in] device The device handle [in] os The device's operating system.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] device The device handle [in] bssid The device's Wi-Fi BSSID.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] device The device handle [in] ipv4_address The device's wifi IPv4 address.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] device The device handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
int ua_foreach_service | ( | ua_service_cb | foreach_cb, |
void * | user_data | ||
) |
Retrieves handles of all added services.
- Since :
- 6.5
- Parameters:
-
[in] foreach_cb Callback function to be invoked with each service handle. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not initialized yet
- See also:
- ua_service_cb()
int ua_get_default_service | ( | ua_service_h * | service | ) |
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] service The service handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not 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] name The service name information [out] service The service handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter or if service with such name does not exist. UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not 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_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_ALREADY_DONE Already 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] location The location handle for location information. [out] distance distance of the detected device and user.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] location The location handle for location information. [out] x x-coordinate of the location. [out] y y-coordinate of the location. [out] z z-coordinate of the location.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] monitor The monitor handle [in] sensor The sensor to be added to monitor
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter or sensor not available to add UA_ERROR_NOT_PERMITTED Operation not permitted UA_ERROR_ALREADY_DONE Already done UA_ERROR_NOT_READY Resource not ready UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
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] monitor The monitor handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not 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] monitor The monitor handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] monitor The monitor handle [in] foreach_cb Callback function to be invoked foreach sensor present in monitor handle. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
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] sensor The sensor for which status to be checked. [out] available TRUE if sensor is available FALSE otherwise.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
int ua_monitor_remove_sensor | ( | ua_monitor_h | monitor, |
ua_sensor_type_e | sensor | ||
) |
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] monitor The monitor handle [in] sensor Sensor to be removed from monitor
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter or sensor not available to remove UA_ERROR_NOT_PERMITTED Operation not permitted UA_ERROR_ALREADY_DONE Already done UA_ERROR_NOT_READY Resource not ready UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
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] monitor The monitor handle [in] location_period location period (0 to UINT_MAX)
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] monitor The monitor handle [in] callback Sensor status changed callback [in] user_data The user data to be passed in sensor state changed callback.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] monitor The monitor handle [in] service The service handle. If service is NULL then monitor will start for default service. [in] mode User 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] callback Callback to be invoked after absence detection. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOW_IN_PROGRESS Operation now in progress UA_ERROR_NO_DATA No sensor available UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
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] monitor The monitor handle [in] service The service handle. If service is NULL then monitor will start for default service. [in] callback Callback to be invoked after device location detection. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOW_IN_PROGRESS Operation now in progress UA_ERROR_NO_DATA No sensor available UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
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] monitor The monitor handle [in] service The service handle. If service is NULL then monitor will start for default service. [in] mode User 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] callback Callback to be invoked after device presence detection. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOW_IN_PROGRESS Operation now in progress UA_ERROR_NO_DATA No sensor available UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
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] monitor The monitor handle [in] scan_time_multiplier A 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] callback It will be called for each scanned device one by one, and on scan completion too. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOW_IN_PROGRESS Operation now in progress UA_ERROR_NO_DATA No sensor available UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
int ua_monitor_stop_absence_detection | ( | ua_monitor_h | monitor | ) |
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] monitor The monitor handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_IN_PROGRESS Operation not in progress UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
- See also:
- ua_monitor_start_absence_detection()
int ua_monitor_stop_location_detection | ( | ua_monitor_h | monitor | ) |
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] monitor UA monitor's handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_IN_PROGRESS Operation not in progress UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
int ua_monitor_stop_presence_detection | ( | ua_monitor_h | monitor | ) |
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] monitor UA monitor's handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_IN_PROGRESS Operation not in progress UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
int ua_monitor_stop_scan | ( | ua_monitor_h | monitor | ) |
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] monitor UA monitor's handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_IN_PROGRESS Operation not in progress UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
- See also:
- ua_monitor_start_scan()
int ua_monitor_unset_sensor_status_changed_cb | ( | ua_monitor_h | monitor | ) |
Unsets sensor status changed callback.
- Since :
- 6.5
- Parameters:
-
[in] monitor The monitor handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not initialized yet
int ua_sensor_get_status | ( | ua_sensor_h | sensor, |
ua_sensor_report_e * | report | ||
) |
Gets sensor's status report.
- Since :
- 6.5
- Parameters:
-
[in] sensor The sensor handle [out] report The sensor's status report.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not initialized yet
int ua_sensor_get_timestamp | ( | ua_sensor_h | sensor, |
unsigned long long * | timestamp | ||
) |
Gets sensor's timestamp.
- Since :
- 6.5
- Parameters:
-
[in] sensor The sensor handle [out] timestamp The sensor's timestamp.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] sensor The sensor handle [out] type The sensor's type.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] service The service handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not 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] service The service handle. [in] user The user handle.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] name The service name information [out] service The service handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not 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] service The service handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] service The service handle. [in] foreach_cb Callback function to be invoked with user handle. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] service The service handle [out] presence_threshold The service presence threshold information (in lux) [out] absence_threshold The service absence threshold information (in lux)
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] service The service handle [out] name The service name information
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] service The service handle [in] account The user account information [out] user The user handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not initialized yet
int ua_service_remove | ( | ua_service_h | service | ) |
Removes the service.
- Since :
- 6.5
- Parameters:
-
[in] service The service handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not 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] service The service handle. [in] user The user handle.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not 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] service The service handle [in] presence_threshold The service presence threshold information (in lux) [in] absence_threshold The service absence threshold information (in lux)
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] service The service handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not 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] user The user handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet UA_ERROR_ALREADY_REGISTERED Already 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] user The user handle. [in] device The device handle. [in] callback Callback to be invoked after adding the user done. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not initialized yet
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] account Account information. Maximum Account string length allowed is 254. [out] user The user handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not 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] user The user handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_NOT_INITIALIZED Not 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] user The user handle. [in] foreach_cb Callback function to be invoked with user device handle. [in] user_data The user data to be passed when callback is called.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not 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] user The user handle [out] account Account information
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OUT_OF_MEMORY Out of memory UA_ERROR_NOT_INITIALIZED Not initialized yet
- See also:
- ua_user_create()
int ua_user_remove | ( | ua_user_h | user | ) |
Removes the user.
- Since :
- 6.5
- Parameters:
-
[in] user The user handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not 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] user The user handle. [in] device The device handle.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
UA_ERROR_NONE Successful UA_ERROR_NOT_SUPPORTED Not Supported UA_ERROR_PERMISSION_DENIED Permission Denied UA_ERROR_INVALID_PARAMETER Invalid parameter UA_ERROR_RESOURCE_BUSY Remove done. but another service uses this device. UA_ERROR_OPERATION_FAILED Operation failed UA_ERROR_NOT_INITIALIZED Not initialized yet
- See also:
- ua_user_add_device()