2007-06-23 04:40:17 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* BlueZ - Bluetooth protocol stack for Linux
|
|
|
|
*
|
2010-01-07 17:02:51 +08:00
|
|
|
* Copyright (C) 2006-2010 Nokia Corporation
|
2010-01-02 09:08:17 +08:00
|
|
|
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
|
2007-06-23 04:40:17 +08:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-02-05 02:48:11 +08:00
|
|
|
#define AUDIO_GATEWAY_INTERFACE "org.bluez.HandsfreeGateway"
|
2007-06-23 04:40:17 +08:00
|
|
|
|
2008-04-21 20:49:16 +08:00
|
|
|
#define DEFAULT_HFP_HS_CHANNEL 7
|
|
|
|
|
2009-04-21 20:49:52 +08:00
|
|
|
typedef enum {
|
|
|
|
GATEWAY_STATE_DISCONNECTED,
|
2010-02-05 02:48:11 +08:00
|
|
|
GATEWAY_STATE_CONNECTING,
|
|
|
|
GATEWAY_STATE_CONNECTED,
|
|
|
|
GATEWAY_STATE_PLAYING,
|
2009-04-21 20:49:52 +08:00
|
|
|
} gateway_state_t;
|
|
|
|
|
2010-02-05 02:48:11 +08:00
|
|
|
typedef void (*gateway_stream_cb_t) (struct audio_device *dev, GError *err,
|
|
|
|
void *user_data);
|
|
|
|
|
|
|
|
void gateway_unregister(struct audio_device *dev);
|
2009-04-03 11:49:47 +08:00
|
|
|
struct gateway *gateway_init(struct audio_device *device);
|
|
|
|
gboolean gateway_is_connected(struct audio_device *dev);
|
2010-02-05 02:48:11 +08:00
|
|
|
int gateway_connect_rfcomm(struct audio_device *dev, GIOChannel *io);
|
2009-04-21 20:49:52 +08:00
|
|
|
int gateway_connect_sco(struct audio_device *dev, GIOChannel *chan);
|
2009-04-03 11:49:47 +08:00
|
|
|
void gateway_start_service(struct audio_device *device);
|
2009-04-08 16:46:55 +08:00
|
|
|
gboolean gateway_request_stream(struct audio_device *dev,
|
|
|
|
gateway_stream_cb_t cb, void *user_data);
|
|
|
|
int gateway_config_stream(struct audio_device *dev, gateway_stream_cb_t cb,
|
|
|
|
void *user_data);
|
|
|
|
gboolean gateway_cancel_stream(struct audio_device *dev, unsigned int id);
|
|
|
|
int gateway_get_sco_fd(struct audio_device *dev);
|
|
|
|
void gateway_suspend_stream(struct audio_device *dev);
|