add the basic framework support for HFP Audio gateway -- take4 --rebased
PATCH 2/4 add the basic framework support for HFP Audio gateway -- take4 --rebased
--- audio/device.c | 4 ++ audio/gateway.c | 64 ++++++++++++++++++++++++++ audio/gateway.h | 12 +++--- audio/manager.c | 133 +++++++++++++++++++++++++++++++++++++++++++------------ 4 files changed, 179 insertions(+), 34 deletions(-)
audio/device.c +4 -0
@@ -53,6 +53,7 @@#include "avdtp.h" #include "control.h" #include "headset.h" +#include "gateway.h" #include "sink.h" #define AUDIO_INTERFACE "org.bluez.Audio"
@@ -602,6 +603,9 @@ gboolean audio_device_is_connected(struct audio_device *dev,else if (!strcmp (interface,AUDIO_CONTROL_INTERFACE ) && dev->control &&control_is_active (dev))return TRUE; +else if (!strcmp (interface,AUDIO_GATEWAY_INTERFACE ) && dev->gateway && +gateway_is_connected (dev)) +return TRUE;return FALSE; }
audio/gateway.c +64 -0
78 lines not on this page · raw message
audio/gateway.h +6 -6
@@ -22,13 +22,13 @@* */ -#define AUDIO_GATEWAY_INTERFACE "org.bluez.Gateway" +#define AUDIO_GATEWAY_INTERFACE "org.bluez.HeadsetGateway"#define DEFAULT_HSP_HS_CHANNEL 6#define DEFAULT_HFP_HS_CHANNEL 7 -int gateway_init (DBusConnection *conn,gboolean disable_hfp,gboolean sco_hci); - -void gateway_exit (void ); - -gboolean gateway_is_enabled (uint16_t svc); +typedef void (*gateway_stream_cb_t ) (struct audio_device *dev,void *user_data); +struct gateway *gateway_init (struct audio_device *device); +gboolean gateway_is_connected (struct audio_device *dev); +int gateway_connect_rfcomm (struct audio_device *dev,GIOChannel *chan); +void gateway_start_service (struct audio_device *device);
audio/manager.c +105 -28
246 lines not on this page · raw message
Signature · 1 line
1.5.4.5