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);
99 int __dundee_manager_init(void);
100 void __dundee_manager_cleanup(void);
103 struct dundee_device;
105 int __dundee_device_init(void);
106 void __dundee_device_cleanup(void);
107 void __dundee_device_shutdown(void);
109 typedef void (*dundee_device_connect_cb_t)(const struct dundee_error *error,
111 typedef void (*dundee_device_disconnect_cb_t)(const struct dundee_error *error,
114 struct dundee_device_driver {
117 /* Connect and dial */
118 void (*connect)(struct dundee_device *device,
119 dundee_device_connect_cb_t cb, void *data);
121 /* Hangup and disconnect */
122 void (*disconnect)(struct dundee_device *device,
123 dundee_device_disconnect_cb_t cb, void *data);
126 struct dundee_device *dundee_device_create(struct dundee_device_driver *d);
127 int dundee_device_register(struct dundee_device *device);
128 void dundee_device_unregister(struct dundee_device *device);
130 void dundee_device_set_data(struct dundee_device *device, void *data);
131 void *dundee_device_get_data(struct dundee_device *device);
133 int dundee_device_set_name(struct dundee_device *device, const char *name);
135 typedef void (*dundee_device_foreach_func)(struct dundee_device *device,
137 void __dundee_device_foreach(dundee_device_foreach_func cb, void *userdata);
139 const char *__dundee_device_get_path(struct dundee_device *device);
140 void __dundee_device_append_properties(struct dundee_device *device,
141 DBusMessageIter *dict);
143 int __dundee_bluetooth_init(void);
144 void __dundee_bluetooth_cleanup(void);