Dynamic interval table for multi handle
[platform/core/location/lbs-dbus.git] / client / include / lbs_dbus_client.h
1 /*
2  * lbs-dbus
3  *
4  * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Youngae Kang <youngae.kang@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
7  *                      Genie Kim <daejins.kim@samsung.com>, Ming Zhu <mingwu.zhu@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21
22 #ifndef __LBS_DBUS_CLIENT_H__
23 #define __LBS_DBUS_CLIENT_H__
24
25 __BEGIN_DECLS
26
27 #include <gio/gio.h>
28
29 #define SERVICE_NAME    "org.tizen.lbs.Providers.LbsServer"
30 #define SERVICE_PATH    "/org/tizen/lbs/Providers/LbsServer"
31
32 typedef enum {
33         LBS_CLIENT_METHOD_GPS = 0,
34         LBS_CLIENT_METHOD_NPS,
35         LBS_CLIENT_METHOD_AGPS,
36         LBS_CLIENT_METHOD_GEOFENCE,
37         LBS_CLIENT_METHOD_MOCK,
38 } lbs_client_method_e;
39
40 typedef enum {
41         LBS_CLIENT_LOCATION_CB = 0x01,
42         LBS_CLIENT_LOCATION_STATUS_CB = LBS_CLIENT_LOCATION_CB << 0x01,
43         LBS_CLIENT_SATELLITE_CB = LBS_CLIENT_LOCATION_CB << 0x02,
44         LBS_CLIENT_NMEA_CB = LBS_CLIENT_LOCATION_CB << 0x03,
45         LBS_CLIENT_BATCH_CB = LBS_CLIENT_LOCATION_CB << 0x04,
46 } lbs_client_callback_e;
47
48 typedef enum {
49         LBS_CLIENT_ERROR_NONE = 0x0,
50         LBS_CLIENT_ERROR_UNKNOWN,
51         LBS_CLIENT_ERROR_PARAMETER,
52         LBS_CLIENT_ERROR_MEMORY,
53         LBS_CLIENT_ERROR_CONNECTION,
54         LBS_CLIENT_ERROR_STATUS,
55         LBS_CLIENT_ERROR_DBUS_CALL,
56         LBS_CLIENT_ERROR_NO_RESULT,
57         LBS_CLIENT_ERROR_ACCESS_DENIED,
58 } lbs_client_error_e;
59
60 typedef void *lbs_client_dbus_h;
61
62 typedef void (*lbs_client_cb)(const char *sig, GVariant *param, void *user_data);
63
64 int lbs_client_create(lbs_client_method_e method, lbs_client_dbus_h *lbs_client);
65 int lbs_client_destroy(lbs_client_dbus_h lbs_client);
66
67 int lbs_client_start(lbs_client_dbus_h lbs_client, unsigned int interval, lbs_client_callback_e callback_type, lbs_client_cb callback, void *user_data);
68 int lbs_client_stop(lbs_client_dbus_h lbs_client, unsigned int interval);
69 int lbs_client_batch_start(lbs_client_dbus_h lbs_client, lbs_client_callback_e callback_type, lbs_client_cb callback, unsigned int batch_interval, unsigned int batch_period, void *user_data);
70 int lbs_client_batch_stop(lbs_client_dbus_h lbs_client);
71
72 int lbs_client_get_nmea(lbs_client_dbus_h lbs_client, int *timestamp, char **nmea);
73 int lbs_client_set_position_update_interval(lbs_client_dbus_h lbs_client, unsigned int interval, unsigned int prev_interval);
74
75 /* Tizen 3.0 */
76 int lbs_client_set_mock_location_async(lbs_client_dbus_h lbs_client,
77         gint method, gdouble latitude, gdouble longitude, gdouble altitude, gdouble speed, gdouble direction, gdouble accuracy, lbs_client_cb callback, void *user_data);
78
79 __END_DECLS
80
81 #endif /* __LBS_DBUS_CLIENT_H__ */
82
83