gchar *service_path;
gchar *signal_path;
int geofence_evt_id;
+ int geofence_proximity_id;
int geofence_evt_status_id;
geofence_client_cb user_cb;
void *user_data;
GEOFENCE_CLIENT_LOGD("Fail to listen GeofenceInout");
}
+ handle->geofence_proximity_id = g_dbus_connection_signal_subscribe(handle->conn, handle->service_name, GEOFENCE_INTERFACE_NAME, "GeofenceProximity", handle->signal_path, NULL, G_DBUS_SIGNAL_FLAGS_NONE, __geofence_signal_callback, handle, NULL);
+
+ if (handle->geofence_proximity_id) {
+ GEOFENCE_CLIENT_LOGD("Listening GeofenceProximity");
+ } else {
+ GEOFENCE_CLIENT_LOGD("Fail to listen GeofenceProximity");
+ }
+
handle->geofence_evt_status_id = g_dbus_connection_signal_subscribe(handle->conn, handle->service_name, GEOFENCE_INTERFACE_NAME, "GeofenceEvent", handle->signal_path, NULL, G_DBUS_SIGNAL_FLAGS_NONE, __geofence_signal_callback, handle, NULL);
if (handle->geofence_evt_status_id) {
g_dbus_connection_signal_unsubscribe(handle->conn, handle->geofence_evt_status_id);
handle->geofence_evt_status_id = 0;
}
+ if (handle->geofence_proximity_id) {
+ g_dbus_connection_signal_unsubscribe(handle->conn, handle->geofence_proximity_id);
+ handle->geofence_proximity_id = 0;
+ }
}
EXPORT_API int geo_client_stop(geofence_client_dbus_h geofence_client)
<arg direction="out" type="i" name="access_type"/>
<arg direction="out" type="i" name="fence_state"/>
</signal>
+ <signal name="GeofenceProximity">
+ <arg direction="out" type="s" name="app_id"/>
+ <arg direction="out" type="i" name="fence_id"/>
+ <arg direction="out" type="i" name="access_type"/>
+ <arg direction="out" type="i" name="fence_proximity_state"/>
+ <arg direction="out" type="i" name="provider"/>
+ </signal>
<!-- Place Management -->
<method name="AddPlace">
Name: geofence-dbus
Summary: Dbus interface for Geofence service
-Version: 0.3.1
+Version: 0.3.2
Release: 1
Group: Location/Libraries
License: Apache-2.0
*/
int geofence_dbus_server_send_geofence_inout_changed(geofence_dbus_server_h geofence_dbus_server, const gchar *app_id, gint fence_id, gint access_type, gint fence_state);
+int geofence_dbus_server_send_geofence_proximity_changed(geofence_dbus_server_h geofence_dbus_server, const gchar *app_id, gint fence_id, gint access_type, gint fence_proximity_state, gint provider);
+
int geofence_dbus_server_send_geofence_event_changed(geofence_dbus_server_h geofence_dbus_server, gint place_id, gint fence_id, gint access_type, const gchar *app_id, gint error, gint state);
typedef struct {
return GEOFENCE_DBUS_SERVER_ERROR_NONE;
}
+EXPORT_API int geofence_dbus_server_send_geofence_proximity_changed(geofence_dbus_server_h geofence_dbus_server, const gchar *app_id, gint fence_id, gint access_type, gint fence_proximity_state, gint provider)
+{
+ GEOFENCE_DBUS_SERVER_LOGD("ENTER >>>");
+ g_return_val_if_fail(geofence_dbus_server, GEOFENCE_DBUS_SERVER_ERROR_PARAMETER);
+
+ geofence_dbus_server_s *handle = (geofence_dbus_server_s *)geofence_dbus_server;
+ g_return_val_if_fail(handle->obj_skeleton, GEOFENCE_DBUS_SERVER_ERROR_PARAMETER);
+
+ SLocGeofence *geofence = NULL;
+ geofence = sloc_object_get_geofence(SLOC_OBJECT(handle->obj_skeleton));
+ g_return_val_if_fail(geofence, GEOFENCE_DBUS_SERVER_ERROR_PARAMETER);
+
+ sloc_geofence_emit_geofence_proximity(geofence, app_id, fence_id, access_type, fence_proximity_state, provider);
+ g_object_unref(geofence);
+
+ return GEOFENCE_DBUS_SERVER_ERROR_NONE;
+}
+
+
EXPORT_API int geofence_dbus_server_send_geofence_event_changed(geofence_dbus_server_h geofence_dbus_server, gint place_id, gint fence_id, gint access_type, const gchar *app_id, gint error, gint state)
{
GEOFENCE_DBUS_SERVER_LOGD("ENTER >>>");