• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2006-2007  Nokia Corporation
6  *  Copyright (C) 2004-2009  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.HeadsetGateway"
26 
27 #define DEFAULT_HSP_HS_CHANNEL 6
28 #define DEFAULT_HFP_HS_CHANNEL 7
29 
30 typedef enum {
31 	GATEWAY_STATE_DISCONNECTED,
32 	GATEWAY_STATE_CONNECTED
33 } gateway_state_t;
34 
35 typedef void (*gateway_stream_cb_t) (struct audio_device *dev, void *user_data);
36 struct gateway *gateway_init(struct audio_device *device);
37 gboolean gateway_is_connected(struct audio_device *dev);
38 int gateway_connect_rfcomm(struct audio_device *dev, GIOChannel *chan);
39 int gateway_connect_sco(struct audio_device *dev, GIOChannel *chan);
40 void gateway_start_service(struct audio_device *device);
41 gboolean gateway_request_stream(struct audio_device *dev,
42 			gateway_stream_cb_t cb, void *user_data);
43 int gateway_config_stream(struct audio_device *dev, gateway_stream_cb_t cb,
44 			void *user_data);
45 gboolean gateway_cancel_stream(struct audio_device *dev, unsigned int id);
46 int gateway_get_sco_fd(struct audio_device *dev);
47 void gateway_suspend_stream(struct audio_device *dev);
48