2010-06-14 18:04:22 +00:00
|
|
|
/*
|
2010-10-01 04:51:34 +00:00
|
|
|
*
|
2010-06-14 18:04:22 +00:00
|
|
|
* oFono - Open Source Telephony
|
|
|
|
*
|
2011-10-10 20:39:54 +00:00
|
|
|
* Copyright (C) 2010 Gustavo F. Padovan <gustavo@padovan.org>
|
2010-06-14 18:04:22 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-09-26 17:26:55 +00:00
|
|
|
#include <ofono/modem.h>
|
|
|
|
#include <ofono/dbus.h>
|
|
|
|
|
2010-06-14 18:04:22 +00:00
|
|
|
#define BLUEZ_SERVICE "org.bluez"
|
|
|
|
#define BLUEZ_MANAGER_INTERFACE BLUEZ_SERVICE ".Manager"
|
|
|
|
#define BLUEZ_ADAPTER_INTERFACE BLUEZ_SERVICE ".Adapter"
|
|
|
|
#define BLUEZ_DEVICE_INTERFACE BLUEZ_SERVICE ".Device"
|
2011-02-08 22:00:58 +00:00
|
|
|
#define BLUEZ_SERVICE_INTERFACE BLUEZ_SERVICE ".Service"
|
2011-12-09 14:56:39 +00:00
|
|
|
#define BLUEZ_SERIAL_INTERFACE BLUEZ_SERVICE ".Serial"
|
2010-06-14 18:04:22 +00:00
|
|
|
|
2010-08-04 10:22:10 +00:00
|
|
|
#define DBUS_TIMEOUT 15
|
|
|
|
|
2011-08-03 11:48:29 +00:00
|
|
|
#define DUN_GW_UUID "00001103-0000-1000-8000-00805f9b34fb"
|
2011-07-01 07:12:22 +00:00
|
|
|
#define HFP_AG_UUID "0000111f-0000-1000-8000-00805f9b34fb"
|
2011-07-01 07:12:23 +00:00
|
|
|
#define HFP_HS_UUID "0000111e-0000-1000-8000-00805f9b34fb"
|
2011-09-26 17:26:55 +00:00
|
|
|
#define SAP_UUID "0000112d-0000-1000-8000-00805f9b34fb"
|
2010-06-14 18:04:22 +00:00
|
|
|
|
|
|
|
struct bluetooth_profile {
|
|
|
|
const char *name;
|
2011-07-04 07:32:16 +00:00
|
|
|
int (*probe)(const char *device, const char *dev_addr,
|
2010-06-14 18:04:22 +00:00
|
|
|
const char *adapter_addr, const char *alias);
|
2011-07-04 07:32:16 +00:00
|
|
|
void (*remove)(const char *prefix);
|
2010-06-14 18:04:22 +00:00
|
|
|
void (*set_alias)(const char *device, const char *);
|
|
|
|
};
|
|
|
|
|
2011-09-26 17:26:55 +00:00
|
|
|
struct bluetooth_sap_driver {
|
|
|
|
const char *name;
|
2011-09-28 21:24:11 +00:00
|
|
|
int (*enable) (struct ofono_modem *modem, struct ofono_modem *sap_modem,
|
|
|
|
int bt_fd);
|
2011-09-28 21:24:16 +00:00
|
|
|
void (*pre_sim) (struct ofono_modem *modem);
|
2011-09-28 21:24:17 +00:00
|
|
|
void (*post_sim) (struct ofono_modem *modem);
|
2011-09-28 21:24:18 +00:00
|
|
|
void (*set_online) (struct ofono_modem *modem, ofono_bool_t online,
|
|
|
|
ofono_modem_online_cb_t cb, void *user_data);
|
2011-09-28 21:24:19 +00:00
|
|
|
void (*post_online) (struct ofono_modem *modem);
|
2011-09-28 21:24:13 +00:00
|
|
|
int (*disable) (struct ofono_modem *modem);
|
2011-09-26 17:26:55 +00:00
|
|
|
};
|
|
|
|
|
2011-02-08 22:00:58 +00:00
|
|
|
struct server;
|
|
|
|
|
|
|
|
typedef void (*ConnectFunc)(GIOChannel *io, GError *err, gpointer user_data);
|
|
|
|
|
2011-09-27 21:04:15 +00:00
|
|
|
void bluetooth_get_properties();
|
2010-06-14 18:04:22 +00:00
|
|
|
int bluetooth_register_uuid(const char *uuid,
|
|
|
|
struct bluetooth_profile *profile);
|
|
|
|
void bluetooth_unregister_uuid(const char *uuid);
|
|
|
|
|
2011-02-08 22:00:58 +00:00
|
|
|
struct server *bluetooth_register_server(guint8 channel, const char *sdp_record,
|
|
|
|
ConnectFunc cb, gpointer user_data);
|
|
|
|
void bluetooth_unregister_server(struct server *server);
|
|
|
|
|
2010-06-14 18:04:27 +00:00
|
|
|
void bluetooth_create_path(const char *dev_addr, const char *adapter_addr,
|
|
|
|
char *buf, int size);
|
|
|
|
|
2010-06-17 10:22:05 +00:00
|
|
|
int bluetooth_send_with_reply(const char *path, const char *interface,
|
2011-09-13 18:58:31 +00:00
|
|
|
const char *method, DBusPendingCall **call,
|
2010-06-17 10:22:05 +00:00
|
|
|
DBusPendingCallNotifyFunction cb,
|
|
|
|
void *user_data, DBusFreeFunction free_func,
|
|
|
|
int timeout, int type, ...);
|
2010-06-17 10:30:25 +00:00
|
|
|
void bluetooth_parse_properties(DBusMessage *reply, const char *property, ...);
|
2011-09-26 17:26:55 +00:00
|
|
|
|
|
|
|
int bluetooth_sap_client_register(struct bluetooth_sap_driver *sap,
|
|
|
|
struct ofono_modem *modem);
|
|
|
|
void bluetooth_sap_client_unregister(struct ofono_modem *modem);
|