1/*
2 *
3 *  BlueZ - Bluetooth protocol stack for Linux
4 *
5 *  Copyright (C) 2006-2010  Nokia Corporation
6 *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
7 *
8 *
9 *  This program is free software; you can redistribute it and/or modify
10 *  it under the terms of the GNU General Public License as published by
11 *  the Free Software Foundation; either version 2 of the License, or
12 *  (at your option) any later version.
13 *
14 *  This program is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this program; if not, write to the Free Software
21 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 *
23 */
24
25#define AUDIO_GATEWAY_INTERFACE "org.bluez.HandsfreeGateway"
26
27#define DEFAULT_HFP_HS_CHANNEL 7
28
29typedef enum {
30	GATEWAY_STATE_DISCONNECTED,
31	GATEWAY_STATE_CONNECTING,
32	GATEWAY_STATE_CONNECTED,
33	GATEWAY_STATE_PLAYING,
34} gateway_state_t;
35
36typedef void (*gateway_stream_cb_t) (struct audio_device *dev, GError *err,
37		void *user_data);
38
39void gateway_unregister(struct audio_device *dev);
40struct gateway *gateway_init(struct audio_device *device);
41gboolean gateway_is_connected(struct audio_device *dev);
42int gateway_connect_rfcomm(struct audio_device *dev, GIOChannel *io);
43int gateway_connect_sco(struct audio_device *dev, GIOChannel *chan);
44void gateway_start_service(struct audio_device *device);
45gboolean gateway_request_stream(struct audio_device *dev,
46			gateway_stream_cb_t cb, void *user_data);
47int gateway_config_stream(struct audio_device *dev, gateway_stream_cb_t cb,
48			void *user_data);
49gboolean gateway_cancel_stream(struct audio_device *dev, unsigned int id);
50int gateway_get_sco_fd(struct audio_device *dev);
51void gateway_suspend_stream(struct audio_device *dev);
52