3 * oFono - Open Source Telephony
5 * Copyright (C) 2008-2012 Intel Corporation. All rights reserved.
6 * Copyright (C) 2012 BMW Car IT GmbH. All rights reserved.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #define OFONO_API_SUBJECT_TO_CHANGE
27 #include <ofono/types.h>
29 void __dundee_exit(void);
31 enum dundee_error_type {
32 DUNDEE_ERROR_TYPE_NO_ERROR = 0,
33 DUNDEE_ERROR_TYPE_FAILURE,
37 enum dundee_error_type type;
47 static inline struct cb_data *cb_data_new(void *cb, void *data)
51 ret = g_new0(struct cb_data, 1);
58 #define CALLBACK_WITH_FAILURE(cb, args...) \
60 struct dundee_error cb_e; \
61 cb_e.type = DUNDEE_ERROR_TYPE_FAILURE; \
67 #define CALLBACK_WITH_SUCCESS(f, args...) \
69 struct dundee_error e; \
70 e.type = DUNDEE_ERROR_TYPE_NO_ERROR; \
75 #include <ofono/log.h>
77 int __ofono_log_init(const char *program, const char *debug,
79 void __ofono_log_cleanup(void);
80 void __ofono_log_enable(struct ofono_debug_desc *start,
81 struct ofono_debug_desc *stop);
83 #include <ofono/dbus.h>
85 #define DUNDEE_SERVICE "org.ofono.dundee"
86 #define DUNDEE_MANAGER_INTERFACE "org.ofono.dundee.Manager"
87 #define DUNDEE_DEVICE_INTERFACE "org.ofono.dundee.Device"
88 #define DUNDEE_MANAGER_PATH "/"
90 int __ofono_dbus_init(DBusConnection *conn);
91 void __ofono_dbus_cleanup(void);
93 void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply);
95 DBusMessage *__dundee_error_invalid_args(DBusMessage *msg);
96 DBusMessage *__dundee_error_failed(DBusMessage *msg);
97 DBusMessage *__dundee_error_timed_out(DBusMessage *msg);
100 int __dundee_manager_init(void);
101 void __dundee_manager_cleanup(void);
104 struct dundee_device;
106 int __dundee_device_init(void);
107 void __dundee_device_cleanup(void);
108 void __dundee_device_shutdown(void);
110 typedef void (*dundee_device_connect_cb_t)(const struct dundee_error *error,
112 typedef void (*dundee_device_disconnect_cb_t)(const struct dundee_error *error,
115 struct dundee_device_driver {
118 /* Connect and dial */
119 void (*connect)(struct dundee_device *device,
120 dundee_device_connect_cb_t cb, void *data);
122 /* Hangup and disconnect */
123 void (*disconnect)(struct dundee_device *device,
124 dundee_device_disconnect_cb_t cb, void *data);
127 struct dundee_device *dundee_device_create(struct dundee_device_driver *d);
128 int dundee_device_register(struct dundee_device *device);
129 void dundee_device_unregister(struct dundee_device *device);
131 void dundee_device_set_data(struct dundee_device *device, void *data);
132 void *dundee_device_get_data(struct dundee_device *device);
134 int dundee_device_set_name(struct dundee_device *device, const char *name);
136 typedef void (*dundee_device_foreach_func)(struct dundee_device *device,
138 void __dundee_device_foreach(dundee_device_foreach_func cb, void *userdata);
140 const char *__dundee_device_get_path(struct dundee_device *device);
141 void __dundee_device_append_properties(struct dundee_device *device,
142 DBusMessageIter *dict);
144 int __dundee_bluetooth_init(void);
145 void __dundee_bluetooth_cleanup(void);