Tizen Native API
5.0
|
The Geofence defines a virtual perimeter.
#include <geofence_manager.h>
Geofence defines a virtual perimeter for a real-world geographic area. If you create a geofence, you can trigger some activities when a device enters(or exits) the geofence defined by you. You can create a geofence with the information of Geopoint, Wi-Fi, or BT. 1. Geopoint: Geofence is specified by coordinates (Latitude and Longitude) and Radius
2. WIFI: Geofence is specified by BSSID of Wi-Fi access point
3. BT: Geofence is specified by Bluetooth address
Basic service set identification (BSSID): The BSSID is the MAC address of the wireless access point (WAP) generated by combining the 24 bit Organization Unique Identifier (the manufacturer's identity) and the manufacturer's assigned 24-bit identifier for the radio chipset in the WAP.
This API is related with the following features:
Functions | |
int | geofence_create_geopoint (int place_id, double latitude, double longitude, int radius, const char *address, geofence_h *fence) |
Creates a geopoint type of new geofence. | |
int | geofence_create_bluetooth (int place_id, const char *bssid, const char *ssid, geofence_h *fence) |
Creates a bluetooth type of new geofence. | |
int | geofence_create_wifi (int place_id, const char *bssid, const char *ssid, geofence_h *fence) |
Creates a Wi-Fi type of new geofence. | |
int | geofence_destroy (geofence_h fence) |
Releases the geofence. | |
int | geofence_get_type (geofence_h fence, geofence_type_e *type) |
Gets the type of geofence. | |
int | geofence_get_place_id (geofence_h fence, int *place_id) |
Gets the ID of place. | |
int | geofence_get_latitude (geofence_h fence, double *latitude) |
Gets the latitude of geofence. | |
int | geofence_get_longitude (geofence_h fence, double *longitude) |
Gets the longitude of geofence. | |
int | geofence_get_radius (geofence_h fence, int *radius) |
Gets the radius of geofence. | |
int | geofence_get_address (geofence_h fence, char **address) |
Gets the address of geofence. | |
int | geofence_get_bssid (geofence_h fence, char **bssid) |
Gets the bssid of geofence. | |
int | geofence_get_ssid (geofence_h fence, char **ssid) |
Gets the ssid of geofence. | |
int | geofence_status_create (int geofence_id, geofence_status_h *status) |
Returns The geofence status of specified geofence. | |
int | geofence_status_destroy (geofence_status_h status) |
Releases the memory, used by the status data. | |
int | geofence_status_get_state (geofence_status_h status, geofence_state_e *state) |
Gets the state of geofence. | |
int | geofence_status_get_duration (geofence_status_h status, int *seconds) |
Gets the amount of seconds geofence is in the current state. |
int geofence_create_bluetooth | ( | int | place_id, |
const char * | bssid, | ||
const char * | ssid, | ||
geofence_h * | fence | ||
) |
Creates a bluetooth type of new geofence.
[in] | place_id | The current place ID |
[in] | bssid | Specifies the value of BSSID of BT MAC address |
[in] | ssid | Specifies the value of SSID of BT Device |
[out] | fence | A geofence handle to be newly created on success |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function |
GEOFENCE_MANAGER_ERROR_EXCEPTION | Exception occurred |
GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED | Access to specified place is denied |
int geofence_create_geopoint | ( | int | place_id, |
double | latitude, | ||
double | longitude, | ||
int | radius, | ||
const char * | address, | ||
geofence_h * | fence | ||
) |
Creates a geopoint type of new geofence.
[in] | place_id | The current place ID |
[in] | latitude | Specifies the value of latitude of geofence [-90.0 ~ 90.0] (degrees) |
[in] | longitude | Specifies the value of longitude of geofence [-180.0 ~ 180.0] (degrees) |
[in] | radius | Specifies the value of radius of geofence [100 ~ 500](meter) |
[in] | address | Specifies the value of address |
[out] | fence | A geofence handle to be newly created on success |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function |
GEOFENCE_MANAGER_ERROR_EXCEPTION | Exception occurred |
GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED | Access to specified place is denied |
int geofence_create_wifi | ( | int | place_id, |
const char * | bssid, | ||
const char * | ssid, | ||
geofence_h * | fence | ||
) |
Creates a Wi-Fi type of new geofence.
[in] | place_id | The current place ID |
[in] | bssid | Specifies the value of BSSID of Wi-Fi MAC address |
[in] | ssid | Specifies the value of SSID of Wi-Fi Device |
[out] | fence | A geofence handle to be newly created on success |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function |
GEOFENCE_MANAGER_ERROR_EXCEPTION | Exception occurred |
GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED | Access to specified place is denied |
int geofence_destroy | ( | geofence_h | fence | ) |
Releases the geofence.
[in] | fence | The geofence handle |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function |
int geofence_get_address | ( | geofence_h | fence, |
char ** | address | ||
) |
Gets the address of geofence.
[in] | fence | The geofence handle |
[out] | address | Specifies the value of address |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_get_bssid | ( | geofence_h | fence, |
char ** | bssid | ||
) |
Gets the bssid of geofence.
[in] | fence | The geofence handle |
[out] | bssid | The bssid of geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_get_latitude | ( | geofence_h | fence, |
double * | latitude | ||
) |
Gets the latitude of geofence.
[in] | fence | The geofence handle |
[out] | latitude | The latitude of geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument. |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_get_longitude | ( | geofence_h | fence, |
double * | longitude | ||
) |
Gets the longitude of geofence.
[in] | fence | The geofence handle |
[out] | longitude | The longitude of geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_get_place_id | ( | geofence_h | fence, |
int * | place_id | ||
) |
Gets the ID of place.
[in] | fence | The geofence handle |
[out] | place_id | The ID of the place |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_get_radius | ( | geofence_h | fence, |
int * | radius | ||
) |
Gets the radius of geofence.
[in] | fence | The geofence handle |
[out] | radius | The radius of geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_get_ssid | ( | geofence_h | fence, |
char ** | ssid | ||
) |
Gets the ssid of geofence.
[in] | fence | The geofence handle |
[out] | ssid | The ssid of geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_get_type | ( | geofence_h | fence, |
geofence_type_e * | type | ||
) |
Gets the type of geofence.
[in] | fence | The geofence handle |
[out] | type | The type of geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_status_create | ( | int | geofence_id, |
geofence_status_h * | status | ||
) |
Returns The geofence status of specified geofence.
[in] | geofence_id | The geofence ID |
[out] | status | The status handle of a specified geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this function |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIED | Access to specified geofence is denied |
int geofence_status_destroy | ( | geofence_status_h | status | ) |
Releases the memory, used by the status data.
[in] | status | The status handle of a specified geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_status_get_duration | ( | geofence_status_h | status, |
int * | seconds | ||
) |
Gets the amount of seconds geofence is in the current state.
[in] | status | The geofence status handle |
[out] | seconds | The amount of seconds geofence is in the current state |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int geofence_status_get_state | ( | geofence_status_h | status, |
geofence_state_e * | state | ||
) |
Gets the state of geofence.
[in] | status | The geofence status handle |
[out] | state | The state of geofence |
0
on success, otherwise a negative error value GEOFENCE_MANAGER_ERROR_NONE | Successful |
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER | Illegal argument |
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED | Not supported |