diff options
Diffstat (limited to 'geofence/include/geofence_client.h')
-rw-r--r-- | geofence/include/geofence_client.h | 87 |
1 files changed, 48 insertions, 39 deletions
diff --git a/geofence/include/geofence_client.h b/geofence/include/geofence_client.h index a5f85a5..2d73956 100644 --- a/geofence/include/geofence_client.h +++ b/geofence/include/geofence_client.h @@ -22,38 +22,40 @@ __BEGIN_DECLS #include <gio/gio.h> +#include <tizen_error.h> + typedef enum { - GEOFENCE_STATUS_CB = 0x01, - GEOFENCE_INOUT_CB = GEOFENCE_STATUS_CB << 0x01, + GEOFENCE_STATUS_CB = 0x01, + GEOFENCE_INOUT_CB = GEOFENCE_STATUS_CB << 0x01, } geofence_client_callback_e; typedef enum { - GEOFENCE_CLIENT_ERROR_NONE = 0x0, - GEOFENCE_CLIENT_ERROR_UNKNOWN, - GEOFENCE_CLIENT_ERROR_PARAMETER, - GEOFENCE_CLIENT_ERROR_MEMORY, - GEOFENCE_CLIENT_ERROR_CONNECTION, - GEOFENCE_CLIENT_ERROR_STATUS, - GEOFENCE_CLIENT_ERROR_DBUS_CALL, - GEOFENCE_CLIENT_ERROR_NO_RESULT, - GEOFENCE_CLIENT_ACCESS_DENIED + GEOFENCE_CLIENT_ERROR_NONE = 0x0, + GEOFENCE_CLIENT_ERROR_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, + GEOFENCE_CLIENT_ERROR_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, + GEOFENCE_CLIENT_ACCESS_DENIED = TIZEN_ERROR_PERMISSION_DENIED, + GEOFENCE_CLIENT_ERROR_CONNECTION = TIZEN_ERROR_GEOFENCE_MANAGER | 0x01, + GEOFENCE_CLIENT_ERROR_DBUS_CALL = TIZEN_ERROR_GEOFENCE_MANAGER | 0x06, } geofence_client_error_e; typedef void *geofence_client_dbus_h; /** -* @brief Callback registered by the client to get the callback for the geofence in/out status +* @brief Callback registered by the client to get the callback for the geofence in/out status */ -typedef void (*geofence_client_cb) (const char *sig, GVariant *param, void *user_data); +typedef void (*geofence_client_cb)(const char *sig, GVariant *param, void *user_data); +#if 0 /** -* @brief Callback registered by the client to get the callback for the geofence event status +* @brief Callback registered by the client to get the callback for the geofence event status */ -typedef void (*geofence_client_event_cb) (const char *sig, GVariant *param, void *user_data); +typedef void (*geofence_client_event_cb)(const char *sig, GVariant *param, void *user_data); +#endif /** * @brief API to add the geofence. This will call the server API. * @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID * @param[in] latitude - latitude value if is a geopoint geofence * @param[in] longitude - longitude value if it is a geopint geofence * @param[in] radius - radius value if it is a geopoint geofence @@ -62,28 +64,22 @@ typedef void (*geofence_client_event_cb) (const char *sig, GVariant *param, void * @retval returns the fence-id of the geofence added * @see geo_client_delete_geofence */ -int geo_client_add_geofence(geofence_client_dbus_h geofence_client, gint place_id, gint geofence_type, gdouble latitude, gdouble longitude, gint radius, const gchar *address, const gchar *bssid, const gchar *ssid); +int geo_client_add_geofence(geofence_client_dbus_h geofence_client, gchar *app_id, gint place_id, gint geofence_type, gdouble latitude, gdouble longitude, gint radius, const gchar *address, const gchar *bssid, const gchar *ssid); /** * @brief API to add the place. This will call the server API * @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID * @param[in] place_name - Name of the place * retval returns the place_id of the place added * @see geo_client_delete_place */ -int geo_client_add_place(geofence_client_dbus_h geofence_client, const gchar *place_name); - -/** -* @brief API to enable the geofence. This will call the server API -* @param[in] geofence_client - Client dbus handle -* @param[in] fence_id - Unique id of the fence -* @param[in] bEnable - enable flag for geofence -*/ -int geo_client_enable_service(geofence_client_dbus_h geofence_client, gint geofence_id, gboolean bEnable); +int geo_client_add_place(geofence_client_dbus_h geofence_client, gchar *appid, const gchar *place_name); /** * @brief API to update the place. This will call the server API * @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID * @param[in] place_id - Unique id of the place * @param[in] place_name - Name of the place[may be a new value] * @return int @@ -91,29 +87,31 @@ int geo_client_enable_service(geofence_client_dbus_h geofence_client, gint geofe GEOFENCE_CLIENT_ERROR_DBUS_CALL if failure * @see geo_client_add_place */ -int geo_client_update_place(geofence_client_dbus_h geofence_client, gint place_id, const gchar *place_name); +int geo_client_update_place(geofence_client_dbus_h geofence_client, gchar *app_id, gint place_id, const gchar *place_name); /** * @brief API to delete the geofence from the server * @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID * @param[in] fence-id - Fence ID of the fence which needs to be deleted * @return int * @retval GEOFENCE_CLIENT_ERROR_NONE if success GEOFENCE_CLIENT_ERROR_DBUS_CALL if failure * @see geo_client_add_geofence */ -int geo_client_delete_geofence(geofence_client_dbus_h geofence_client, gint fence_id); +int geo_client_delete_geofence(geofence_client_dbus_h geofence_client, gchar *app_id, gint fence_id); /** * @brief API to delete the place from the server * @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID * @param[in] place_id - Place ID of the place which needs to be deleted * @return int * @retval GEOFENCE_CLIENT_ERROR_NONE if success GEOFENCE_CLIENT_ERROR_DBUS_CALL if failure * @see geo_client_add_place */ -int geo_client_delete_place(geofence_client_dbus_h geofence_client, gint place_id); +int geo_client_delete_place(geofence_client_dbus_h geofence_client, gchar *app_id, gint place_id); /** * @brief API to get the place name @@ -124,11 +122,12 @@ int geo_client_delete_place(geofence_client_dbus_h geofence_client, gint place_i * @return GEOFENCE_CLIENT_ERROR_NONE if success GEOFENCE_CLIENT_ERROR_DBUS_CALL if failure */ -int geo_client_get_place_name(geofence_client_dbus_h geofence_client, gint place_id, char **placeName, int *errorCode); +int geo_client_get_place_name(geofence_client_dbus_h geofence_client, gchar *app_id, gint place_id, gchar **place_name, gint *error_code); /** * @brief API to get the fence list * @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID * @param[in] place_id - ID of the place whose list has to be retrived * @param[out] iter - iterator for the array of fences * @param[out] fenceCnt - total count of the fence @@ -137,11 +136,12 @@ int geo_client_get_place_name(geofence_client_dbus_h geofence_client, gint place * @retval GEOFENCE_CLIENT_ERROR_NONE if success GEOFENCE_CLIENT_ERROR_DBUS_CALL if failure */ -int geo_client_get_list(geofence_client_dbus_h geofence_client, int place_id, GVariantIter **iter, gint *fenceCnt, int *errorCode); +int geo_client_get_geofences(geofence_client_dbus_h geofence_client, gchar *app_id, gint place_id, GVariantIter **iter, gint *fence_cnt, gint *error_code); /** * @brief API to get the place list * @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID * @param[out] iter - iterator for the array of fences * @param[out] placeCnt - total count of the fence * @param[out] errorCode - error code for the API @@ -149,34 +149,43 @@ int geo_client_get_list(geofence_client_dbus_h geofence_client, int place_id, GV * @retval GEOFENCE_CLIENT_ERROR_NONE if success GEOFENCE_CLIENT_ERROR_DBUS_CALL if failure */ -int geo_client_get_place_list(geofence_client_dbus_h geofence_client, GVariantIter **iter, gint *fenceCnt, int *errorCode); +int geo_client_get_places(geofence_client_dbus_h geofence_client, gchar *app_id, GVariantIter **iter, gint *fence_cnt, int *error_code); + +/** +* @brief API to enable the geofence. This will call the server API +* @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID +* @param[in] fence_id - Unique id of the fence +* @param[in] bEnable - enable flag for geofence +*/ +int geo_client_enable_geofence(geofence_client_dbus_h geofence_client, gchar *app_id, gint geofence_id, gboolean onoff); /** * @brief API to start the geofence service on a particular geofence +* @param[in] app_id - Caller's application ID * @param[in] geofence_client - Client dbus handle * @param[in] fence-id - Fence ID of the fence for which geofence service should be started * @return int * @retval GEOFENCE_CLIENT_ERROR_NONE if success GEOFENCE_CLIENT_ERROR_DBUS_CALL if failure -* @see geo_client_stop_geofence +* @see geo_client_stop_geofence */ -int geo_client_start_geofence(geofence_client_dbus_h geofence_client, gint fence_id); +int geo_client_start_geofence(geofence_client_dbus_h geofence_client, gchar *app_id, gint fence_id); /** * @brief API to stop the geofence service on a particular geofence * @param[in] geofence_client - Client dbus handle +* @param[in] app_id - Caller's application ID * @param[in] fence-id - Fence ID of the fence for which geofence service should be stopped * @return int * @retval GEOFENCE_CLIENT_ERROR_NONE if success GEOFENCE_CLIENT_ERROR_DBUS_CALL if failure -* @see geo_client_start_geofence +* @see geo_client_start_geofence */ -int geo_client_stop_geofence(geofence_client_dbus_h geofence_client, gint fence_id); +int geo_client_stop_geofence(geofence_client_dbus_h geofence_client, gchar *app_id, gint fence_id); /** * @brief API to start the client and make a subscription to the server -* @param[in] service_name - Name of the service required by the client -* @param[in] service_path - Path of the service for dbus connection * @param[in] geofence_client - Client dbus handle * @param[in] callback - callback registered by the client * @param[in] user_data - Data that has to come back in the callback @@ -186,7 +195,7 @@ int geo_client_stop_geofence(geofence_client_dbus_h geofence_client, gint fence_ GEOFENCE_CLIENT_ERROR_DBUS_CALL - if failure * @see geo_client_stop */ -int geo_client_start(char *service_name, char *service_path, geofence_client_dbus_h *geofence_client, geofence_client_cb callback, geofence_client_event_cb evt_callback, void *user_data); +int geo_client_start(geofence_client_dbus_h geofence_client, geofence_client_cb callback, void *user_data); /** * @brief API to stop the client and remove the subscription to the server @@ -197,7 +206,7 @@ int geo_client_start(char *service_name, char *service_path, geofence_client_dbu GEOFENCE_CLIENT_ERROR_DBUS_CALL - if failure * @see geo_client_start */ -int geo_client_stop(geofence_client_dbus_h *geofence_client); +int geo_client_stop(geofence_client_dbus_h geofence_client); /** * @brief API to create the connection with the server |