diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/a2dp.c | 14 | ||||
-rw-r--r-- | audio/a2dp.h | 2 | ||||
-rw-r--r-- | audio/avdtp.c | 6 | ||||
-rw-r--r-- | audio/control.c | 14 | ||||
-rw-r--r-- | audio/control.h | 10 | ||||
-rw-r--r-- | audio/device.c | 28 | ||||
-rw-r--r-- | audio/device.h | 14 | ||||
-rw-r--r-- | audio/headset.c | 118 | ||||
-rw-r--r-- | audio/headset.h | 42 | ||||
-rw-r--r-- | audio/main.c | 49 | ||||
-rw-r--r-- | audio/manager.c | 56 | ||||
-rw-r--r-- | audio/manager.h | 6 | ||||
-rw-r--r-- | audio/sink.c | 18 | ||||
-rw-r--r-- | audio/sink.h | 10 | ||||
-rw-r--r-- | audio/unix.c | 28 |
15 files changed, 215 insertions, 200 deletions
diff --git a/audio/a2dp.c b/audio/a2dp.c index c3292fef..3e89d6b1 100644 --- a/audio/a2dp.c +++ b/audio/a2dp.c @@ -131,7 +131,7 @@ static void setup_unref(struct a2dp_setup *setup) setup_free(setup); } -static struct device *a2dp_get_dev(struct avdtp *session) +static struct audio_device *a2dp_get_dev(struct avdtp *session) { bdaddr_t addr; @@ -242,13 +242,13 @@ static struct a2dp_setup *find_setup_by_session(struct avdtp *session) return NULL; } -static struct a2dp_setup *find_setup_by_dev(struct device *dev) +static struct a2dp_setup *find_setup_by_dev(struct audio_device *dev) { GSList *l; for (l = setups; l != NULL; l = l->next) { struct a2dp_setup *setup = l->data; - struct device *setup_dev = a2dp_get_dev(setup->session); + struct audio_device *setup_dev = a2dp_get_dev(setup->session); if (setup_dev == dev) return setup; @@ -289,7 +289,7 @@ static gboolean sbc_setconf_ind(struct avdtp *session, uint8_t *category, void *user_data) { struct a2dp_sep *a2dp_sep = user_data; - struct device *dev; + struct audio_device *dev; struct avdtp_service_capability *cap; struct avdtp_media_codec_capability *codec_cap; struct sbc_codec_cap *sbc_cap; @@ -395,7 +395,7 @@ static gboolean mpeg_setconf_ind(struct avdtp *session, uint8_t *category, void *user_data) { struct a2dp_sep *a2dp_sep = user_data; - struct device *dev; + struct audio_device *dev; if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK) debug("Sink %p: Set_Configuration_Ind", sep); @@ -473,7 +473,7 @@ static void setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep, { struct a2dp_sep *a2dp_sep = user_data; struct a2dp_setup *setup; - struct device *dev; + struct audio_device *dev; int ret; if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK) @@ -1163,7 +1163,7 @@ void a2dp_exit() dbus_connection_unref(connection); } -gboolean a2dp_source_cancel(struct device *dev, unsigned int id) +gboolean a2dp_source_cancel(struct audio_device *dev, unsigned int id) { struct a2dp_setup_cb *cb_data; struct a2dp_setup *setup; diff --git a/audio/a2dp.h b/audio/a2dp.h index 1e4ab408..6ec3ebc8 100644 --- a/audio/a2dp.h +++ b/audio/a2dp.h @@ -138,7 +138,7 @@ unsigned int a2dp_source_resume(struct avdtp *session, struct a2dp_sep *sep, a2dp_stream_cb_t cb, void *user_data); unsigned int a2dp_source_suspend(struct avdtp *session, struct a2dp_sep *sep, a2dp_stream_cb_t cb, void *user_data); -gboolean a2dp_source_cancel(struct device *dev, unsigned int id); +gboolean a2dp_source_cancel(struct audio_device *dev, unsigned int id); gboolean a2dp_sep_lock(struct a2dp_sep *sep, struct avdtp *session); gboolean a2dp_sep_unlock(struct a2dp_sep *sep, struct avdtp *session); diff --git a/audio/avdtp.c b/audio/avdtp.c index 38fc19c6..b0cd98ba 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -735,7 +735,7 @@ static void release_stream(struct avdtp_stream *stream, struct avdtp *session) static void connection_lost(struct avdtp *session, int err) { - struct device *dev; + struct audio_device *dev; dev = manager_find_device(&session->dst, AUDIO_CONTROL_INTERFACE, FALSE); @@ -1550,7 +1550,7 @@ static void l2cap_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, } if (session->state == AVDTP_SESSION_STATE_CONNECTING) { - struct device *dev; + struct audio_device *dev; session->mtu = l2o.imtu; session->buf = g_malloc0(session->mtu); @@ -2684,7 +2684,7 @@ int avdtp_unregister_sep(struct avdtp_local_sep *sep) static void auth_cb(DBusError *derr, void *user_data) { struct avdtp *session = user_data; - struct device *dev; + struct audio_device *dev; GIOChannel *io; if (derr && dbus_error_is_set(derr)) { diff --git a/audio/control.c b/audio/control.c index 9dfcd46d..b10fb1dd 100644 --- a/audio/control.c +++ b/audio/control.c @@ -151,7 +151,7 @@ struct avrcp_header { #endif struct avctp { - struct device *dev; + struct audio_device *dev; avctp_state_t state; @@ -804,7 +804,7 @@ static void avctp_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, (GIOFunc) session_cb, session); } -gboolean avrcp_connect(struct device *dev) +gboolean avrcp_connect(struct audio_device *dev) { struct control *control = dev->control; struct avctp *session; @@ -835,7 +835,7 @@ gboolean avrcp_connect(struct device *dev) return TRUE; } -void avrcp_disconnect(struct device *dev) +void avrcp_disconnect(struct audio_device *dev) { struct control *control = dev->control; struct avctp *session = control->session; @@ -924,7 +924,7 @@ static DBusHandlerResult control_is_connected(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct control *control = device->control; DBusMessage *reply; dbus_bool_t connected; @@ -954,7 +954,7 @@ static DBusSignalVTable control_signals[] = { { NULL, NULL } }; -struct control *control_init(struct device *dev) +struct control *control_init(struct audio_device *dev) { if (!dbus_connection_register_interface(dev->conn, dev->path, AUDIO_CONTROL_INTERFACE, @@ -965,7 +965,7 @@ struct control *control_init(struct device *dev) return g_new0(struct control, 1); } -void control_free(struct device *dev) +void control_free(struct audio_device *dev) { struct control *control = dev->control; @@ -976,7 +976,7 @@ void control_free(struct device *dev) dev->control = NULL; } -gboolean control_is_active(struct device *dev) +gboolean control_is_active(struct audio_device *dev) { struct control *control = dev->control; diff --git a/audio/control.h b/audio/control.h index 4f3b7e00..bbb5128c 100644 --- a/audio/control.h +++ b/audio/control.h @@ -27,9 +27,9 @@ int avrcp_init(DBusConnection *conn, GKeyFile *config); void avrcp_exit(void); -gboolean avrcp_connect(struct device *dev); -void avrcp_disconnect(struct device *dev); +gboolean avrcp_connect(struct audio_device *dev); +void avrcp_disconnect(struct audio_device *dev); -struct control *control_init(struct device *dev); -void control_free(struct device *dev); -gboolean control_is_active(struct device *dev); +struct control *control_init(struct audio_device *dev); +void control_free(struct audio_device *dev); +gboolean control_is_active(struct audio_device *dev); diff --git a/audio/device.c b/audio/device.c index 6760d4bb..6b8c5318 100644 --- a/audio/device.c +++ b/audio/device.c @@ -57,7 +57,7 @@ static DBusHandlerResult device_get_address(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; DBusMessage *reply; char address[18], *ptr = address; @@ -90,7 +90,7 @@ static char *get_dev_name(DBusConnection *conn, const bdaddr_t *src, static DBusHandlerResult device_get_name(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *dev = data; + struct audio_device *dev = data; DBusMessage *reply; const char *name = dev->name ? dev->name : ""; @@ -107,7 +107,7 @@ static DBusHandlerResult device_get_name(DBusConnection *conn, static DBusHandlerResult device_get_adapter(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; DBusMessage *reply; char address[18], *ptr = address; @@ -128,7 +128,7 @@ static DBusHandlerResult device_get_connected(DBusConnection *conn, DBusMessage *msg, void *data) { DBusMessageIter iter, array_iter; - struct device *device = data; + struct audio_device *device = data; DBusMessage *reply; const char *iface; @@ -162,7 +162,7 @@ static DBusMethodVTable device_methods[] = { { NULL, NULL, NULL, NULL } }; -static void device_free(struct device *dev) +static void device_free(struct audio_device *dev) { if (dev->headset) headset_free(dev); @@ -185,17 +185,17 @@ static void device_free(struct device *dev) static void device_unregister(DBusConnection *conn, void *data) { - struct device *device = data; + struct audio_device *device = data; info("Unregistered device path:%s", device->path); device_free(device); } -struct device *device_register(DBusConnection *conn, +struct audio_device *device_register(DBusConnection *conn, const char *path, const bdaddr_t *bda) { - struct device *dev; + struct audio_device *dev; bdaddr_t src; int dev_id; @@ -207,7 +207,7 @@ struct device *device_register(DBusConnection *conn, if ((dev_id < 0) || (hci_devba(dev_id, &src) < 0)) return NULL; - dev = g_new0(struct device, 1); + dev = g_new0(struct audio_device, 1); /* FIXME just to maintain compatibility */ dev->adapter_path = g_strdup_printf("/org/bluez/hci%d", dev_id); @@ -241,7 +241,7 @@ struct device *device_register(DBusConnection *conn, return dev; } -int device_store(struct device *dev, gboolean is_default) +int device_store(struct audio_device *dev, gboolean is_default) { char value[64]; char filename[PATH_MAX + 1]; @@ -285,7 +285,7 @@ int device_store(struct device *dev, gboolean is_default) return textfile_put(filename, dst_addr, value); } -int device_remove_stored(struct device *dev) +int device_remove_stored(struct audio_device *dev) { char filename[PATH_MAX + 1]; char src_addr[18], dst_addr[18]; @@ -298,7 +298,7 @@ int device_remove_stored(struct device *dev) return textfile_del(filename, dst_addr); } -void device_finish_sdp_transaction(struct device *dev) +void device_finish_sdp_transaction(struct audio_device *dev) { char address[18], *addr_ptr = address; DBusMessage *msg; @@ -391,7 +391,7 @@ static uint8_t hs_to_ipc_state(headset_state_t state) } } -uint8_t device_get_state(struct device *dev) +uint8_t device_get_state(struct audio_device *dev) { avdtp_state_t sink_state; headset_state_t hs_state; @@ -411,7 +411,7 @@ uint8_t device_get_state(struct device *dev) } #endif -gboolean device_is_connected(struct device *dev, const char *interface) +gboolean device_is_connected(struct audio_device *dev, const char *interface) { if (!interface) { if ((dev->sink || dev->source) && diff --git a/audio/device.h b/audio/device.h index 44515bf4..5dc99b9d 100644 --- a/audio/device.h +++ b/audio/device.h @@ -52,7 +52,7 @@ struct sink; struct headset; struct gateway; -struct device { +struct audio_device { DBusConnection *conn; char *adapter_path; char *path; @@ -69,15 +69,15 @@ struct device { struct target *target; }; -struct device *device_register(DBusConnection *conn, +struct audio_device *device_register(DBusConnection *conn, const char *path, const bdaddr_t *bda); -int device_store(struct device *device, gboolean is_default); +int device_store(struct audio_device *device, gboolean is_default); -int device_remove_stored(struct device *dev); +int device_remove_stored(struct audio_device *dev); -void device_finish_sdp_transaction(struct device *device); +void device_finish_sdp_transaction(struct audio_device *device); -uint8_t device_get_state(struct device *dev); +uint8_t device_get_state(struct audio_device *dev); -gboolean device_is_connected(struct device *dev, const char *interface); +gboolean device_is_connected(struct audio_device *dev, const char *interface); diff --git a/audio/headset.c b/audio/headset.c index 6198ace7..69b89a77 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -142,12 +142,12 @@ struct headset { struct event { const char *cmd; - int (*callback) (struct device *device, const char *buf); + int (*callback) (struct audio_device *device, const char *buf); }; -static int rfcomm_connect(struct device *device, headset_stream_cb_t cb, +static int rfcomm_connect(struct audio_device *device, headset_stream_cb_t cb, void *user_data, unsigned int *cb_id); -static int get_records(struct device *device, headset_stream_cb_t cb, +static int get_records(struct audio_device *device, headset_stream_cb_t cb, void *user_data, unsigned int *cb_id); static int headset_send(struct headset *hs, char *format, ...) @@ -183,7 +183,7 @@ static int headset_send(struct headset *hs, char *format, ...) return 0; } -static int supported_features(struct device *device, const char *buf) +static int supported_features(struct audio_device *device, const char *buf) { struct headset *hs = device->headset; int err; @@ -199,7 +199,7 @@ static int supported_features(struct device *device, const char *buf) return headset_send(hs, "\r\nOK\r\n"); } -static int report_indicators(struct device *device, const char *buf) +static int report_indicators(struct audio_device *device, const char *buf) { struct headset *hs = device->headset; int err; @@ -216,7 +216,7 @@ static int report_indicators(struct device *device, const char *buf) return headset_send(hs, "\r\nOK\r\n"); } -static void pending_connect_complete(struct connect_cb *cb, struct device *dev) +static void pending_connect_complete(struct connect_cb *cb, struct audio_device *dev) { struct headset *hs = dev->headset; @@ -226,7 +226,7 @@ static void pending_connect_complete(struct connect_cb *cb, struct device *dev) cb->cb(dev, cb->cb_data); } -static void pending_connect_finalize(struct device *dev) +static void pending_connect_finalize(struct audio_device *dev) { struct headset *hs = dev->headset; struct pending_connect *p = hs->pending; @@ -292,7 +292,7 @@ static void sco_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, const bdaddr_t *dst, gpointer user_data) { int sk; - struct device *dev = user_data; + struct audio_device *dev = user_data; struct headset *hs = dev->headset; struct pending_connect *p = hs->pending; @@ -331,7 +331,7 @@ static void sco_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, headset_set_state(dev, HEADSET_STATE_PLAYING); } -static int sco_connect(struct device *dev, headset_stream_cb_t cb, +static int sco_connect(struct audio_device *dev, headset_stream_cb_t cb, void *user_data, unsigned int *cb_id) { struct headset *hs = dev->headset; @@ -360,7 +360,7 @@ static int sco_connect(struct device *dev, headset_stream_cb_t cb, return 0; } -static void hfp_slc_complete(struct device *dev) +static void hfp_slc_complete(struct audio_device *dev) { struct headset *hs = dev->headset; struct pending_connect *p = hs->pending; @@ -387,7 +387,7 @@ static void hfp_slc_complete(struct device *dev) pending_connect_finalize(dev); } -static int event_reporting(struct device *dev, const char *buf) +static int event_reporting(struct audio_device *dev, const char *buf) { struct headset *hs = dev->headset; int ret; @@ -407,7 +407,7 @@ static int event_reporting(struct device *dev, const char *buf) return 0; } -static int call_hold(struct device *dev, const char *buf) +static int call_hold(struct audio_device *dev, const char *buf) { struct headset *hs = dev->headset; int err; @@ -428,7 +428,7 @@ static int call_hold(struct device *dev, const char *buf) return 0; } -static int answer_call(struct device *device, const char *buf) +static int answer_call(struct audio_device *device, const char *buf) { struct headset *hs = device->headset; int err; @@ -463,7 +463,7 @@ static int answer_call(struct device *device, const char *buf) return headset_send(hs, "\r\n+CIEV:3,0\r\n"); } -static int terminate_call(struct device *device, const char *buf) +static int terminate_call(struct audio_device *device, const char *buf) { struct headset *hs = device->headset; int err; @@ -492,7 +492,7 @@ static int terminate_call(struct device *device, const char *buf) return headset_send(hs, "\r\n+CIEV:2,0\r\n"); } -static int cli_notification(struct device *device, const char *buf) +static int cli_notification(struct audio_device *device, const char *buf) { struct headset *hs = device->headset; @@ -504,7 +504,7 @@ static int cli_notification(struct device *device, const char *buf) return headset_send(hs, "\r\nOK\r\n"); } -static int signal_gain_setting(struct device *device, const char *buf) +static int signal_gain_setting(struct audio_device *device, const char *buf) { struct headset *hs = device->headset; const char *name; @@ -562,7 +562,7 @@ static struct event event_callbacks[] = { { 0 } }; -static int handle_event(struct device *device, const char *buf) +static int handle_event(struct audio_device *device, const char *buf) { struct event *ev; @@ -576,7 +576,7 @@ static int handle_event(struct device *device, const char *buf) return -EINVAL; } -static void close_sco(struct device *device) +static void close_sco(struct audio_device *device) { struct headset *hs = device->headset; @@ -590,7 +590,7 @@ static void close_sco(struct device *device) } static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond, - struct device *device) + struct audio_device *device) { struct headset *hs; unsigned char buf[BUF_SIZE]; @@ -659,7 +659,7 @@ failed: } static gboolean sco_cb(GIOChannel *chan, GIOCondition cond, - struct device *device) + struct audio_device *device) { struct headset *hs; @@ -678,7 +678,7 @@ static gboolean sco_cb(GIOChannel *chan, GIOCondition cond, static void rfcomm_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, const bdaddr_t *dst, gpointer user_data) { - struct device *dev = user_data; + struct audio_device *dev = user_data; struct headset *hs = dev->headset; struct pending_connect *p = hs->pending; char hs_address[18]; @@ -736,7 +736,7 @@ failed: static void get_record_cb(sdp_list_t *recs, int err, gpointer user_data) { - struct device *dev = user_data; + struct audio_device *dev = user_data; struct headset *hs = dev->headset; struct pending_connect *p = hs->pending; int ch = -1; @@ -826,7 +826,7 @@ failed: headset_set_state(dev, HEADSET_STATE_DISCONNECTED); } -static int get_records(struct device *device, headset_stream_cb_t cb, +static int get_records(struct audio_device *device, headset_stream_cb_t cb, void *user_data, unsigned int *cb_id) { struct headset *hs = device->headset; @@ -851,7 +851,7 @@ static int get_records(struct device *device, headset_stream_cb_t cb, get_record_cb, device, NULL); } -static int rfcomm_connect(struct device *dev, headset_stream_cb_t cb, +static int rfcomm_connect(struct audio_device *dev, headset_stream_cb_t cb, void *user_data, unsigned int *cb_id) { struct headset *hs = dev->headset; @@ -890,7 +890,7 @@ static int rfcomm_connect(struct device *dev, headset_stream_cb_t cb, static DBusHandlerResult hs_stop(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply = NULL; @@ -910,7 +910,7 @@ static DBusHandlerResult hs_stop(DBusConnection *conn, DBusMessage *msg, static DBusHandlerResult hs_is_playing(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply; dbus_bool_t playing; @@ -932,7 +932,7 @@ static DBusHandlerResult hs_is_playing(DBusConnection *conn, DBusMessage *msg, static DBusHandlerResult hs_disconnect(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply = NULL; char hs_address[18]; @@ -957,7 +957,7 @@ static DBusHandlerResult hs_is_connected(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; DBusMessage *reply; dbus_bool_t connected; @@ -978,7 +978,7 @@ static DBusHandlerResult hs_is_connected(DBusConnection *conn, static DBusHandlerResult hs_connect(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; int err; @@ -1000,7 +1000,7 @@ static DBusHandlerResult hs_connect(DBusConnection *conn, DBusMessage *msg, static gboolean ring_timer_cb(gpointer data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; int err; @@ -1025,7 +1025,7 @@ static gboolean ring_timer_cb(gpointer data) static DBusHandlerResult hs_ring(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply = NULL; int err; @@ -1069,7 +1069,7 @@ static DBusHandlerResult hs_cancel_ringing(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply = NULL; @@ -1107,7 +1107,7 @@ done: static DBusHandlerResult hs_play(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; int err; @@ -1143,7 +1143,7 @@ static DBusHandlerResult hs_get_speaker_gain(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply; dbus_uint16_t gain; @@ -1169,7 +1169,7 @@ static DBusHandlerResult hs_get_mic_gain(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply; dbus_uint16_t gain; @@ -1195,7 +1195,7 @@ static DBusHandlerResult hs_set_gain(DBusConnection *conn, DBusMessage *msg, void *data, char type) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply; DBusError derr; @@ -1272,7 +1272,7 @@ static DBusHandlerResult hf_setup_call(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply; DBusError derr; @@ -1322,7 +1322,7 @@ static DBusHandlerResult hf_identify_call(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct headset *hs = device->headset; DBusMessage *reply; DBusError derr; @@ -1414,7 +1414,7 @@ static void headset_set_channel(struct headset *headset, sdp_record_t *record, error("Unable to get RFCOMM channel from Headset record"); } -void headset_update(struct device *dev, sdp_record_t *record, uint16_t svc) +void headset_update(struct audio_device *dev, sdp_record_t *record, uint16_t svc) { struct headset *headset = dev->headset; @@ -1452,7 +1452,7 @@ void headset_update(struct device *dev, sdp_record_t *record, uint16_t svc) headset_set_channel(headset, record, svc); } -struct headset *headset_init(struct device *dev, sdp_record_t *record, +struct headset *headset_init(struct audio_device *dev, sdp_record_t *record, uint16_t svc) { struct headset *hs; @@ -1607,7 +1607,7 @@ uint32_t headset_config_init(GKeyFile *config) return ag_features; } -void headset_free(struct device *dev) +void headset_free(struct audio_device *dev) { struct headset *hs = dev->headset; @@ -1630,13 +1630,13 @@ void headset_free(struct device *dev) dev->headset = NULL; } -static gboolean hs_dc_timeout(struct device *dev) +static gboolean hs_dc_timeout(struct audio_device *dev) { headset_set_state(dev, HEADSET_STATE_DISCONNECTED); return FALSE; } -gboolean headset_cancel_stream(struct device *dev, unsigned int id) +gboolean headset_cancel_stream(struct audio_device *dev, unsigned int id) { struct headset *hs = dev->headset; struct pending_connect *p = hs->pending; @@ -1678,13 +1678,13 @@ gboolean headset_cancel_stream(struct device *dev, unsigned int id) return TRUE; } -static gboolean dummy_connect_complete(struct device *dev) +static gboolean dummy_connect_complete(struct audio_device *dev) { pending_connect_finalize(dev); return FALSE; } -unsigned int headset_request_stream(struct device *dev, headset_stream_cb_t cb, +unsigned int headset_request_stream(struct audio_device *dev, headset_stream_cb_t cb, void *user_data) { struct headset *hs = dev->headset; @@ -1718,21 +1718,21 @@ unsigned int headset_request_stream(struct device *dev, headset_stream_cb_t cb, return id; } -gboolean get_hfp_active(struct device *dev) +gboolean get_hfp_active(struct audio_device *dev) { struct headset *hs = dev->headset; return hs->hfp_active; } -void set_hfp_active(struct device *dev, gboolean active) +void set_hfp_active(struct audio_device *dev, gboolean active) { struct headset *hs = dev->headset; hs->hfp_active = active; } -int headset_connect_rfcomm(struct device *dev, GIOChannel *io) +int headset_connect_rfcomm(struct audio_device *dev, GIOChannel *io) { struct headset *hs = dev->headset; @@ -1741,7 +1741,7 @@ int headset_connect_rfcomm(struct device *dev, GIOChannel *io) return hs->tmp_rfcomm ? 0 : -EINVAL; } -int headset_close_rfcomm(struct device *dev) +int headset_close_rfcomm(struct audio_device *dev) { struct headset *hs = dev->headset; GIOChannel *rfcomm = hs->tmp_rfcomm ? hs->tmp_rfcomm : hs->rfcomm; @@ -1764,7 +1764,7 @@ int headset_close_rfcomm(struct device *dev) return 0; } -void headset_set_authorized(struct device *dev) +void headset_set_authorized(struct audio_device *dev) { struct headset *hs = dev->headset; @@ -1781,7 +1781,7 @@ void headset_set_authorized(struct device *dev) headset_set_state(dev, HEADSET_STATE_CONNECTED); } -void headset_set_state(struct device *dev, headset_state_t state) +void headset_set_state(struct audio_device *dev, headset_state_t state) { struct headset *hs = dev->headset; @@ -1836,21 +1836,21 @@ void headset_set_state(struct device *dev, headset_state_t state) hs->state = state; } -headset_state_t headset_get_state(struct device *dev) +headset_state_t headset_get_state(struct audio_device *dev) { struct headset *hs = dev->headset; return hs->state; } -int headset_get_channel(struct device *dev) +int headset_get_channel(struct audio_device *dev) { struct headset *hs = dev->headset; return hs->rfcomm_ch; } -gboolean headset_is_active(struct device *dev) +gboolean headset_is_active(struct audio_device *dev) { struct headset *hs = dev->headset; @@ -1860,7 +1860,7 @@ gboolean headset_is_active(struct device *dev) return FALSE; } -gboolean headset_lock(struct device *dev, headset_lock_t lock) +gboolean headset_lock(struct audio_device *dev, headset_lock_t lock) { struct headset *hs = dev->headset; @@ -1872,7 +1872,7 @@ gboolean headset_lock(struct device *dev, headset_lock_t lock) return TRUE; } -gboolean headset_unlock(struct device *dev, headset_lock_t lock) +gboolean headset_unlock(struct audio_device *dev, headset_lock_t lock) { struct headset *hs = dev->headset; @@ -1899,17 +1899,17 @@ gboolean headset_unlock(struct device *dev, headset_lock_t lock) return TRUE; } -gboolean headset_suspend(struct device *dev, void *data) +gboolean headset_suspend(struct audio_device *dev, void *data) { return TRUE; } -gboolean headset_play(struct device *dev, void *data) +gboolean headset_play(struct audio_device *dev, void *data) { return TRUE; } -int headset_get_sco_fd(struct device *dev) +int headset_get_sco_fd(struct audio_device *dev) { struct headset *hs = dev->headset; diff --git a/audio/headset.h b/audio/headset.h index 188971a5..b61a1015 100644 --- a/audio/headset.h +++ b/audio/headset.h @@ -40,38 +40,38 @@ typedef enum { HEADSET_LOCK_WRITE = 1 << 1, } headset_lock_t; -typedef void (*headset_stream_cb_t) (struct device *dev, void *user_data); +typedef void (*headset_stream_cb_t) (struct audio_device *dev, void *user_data); -struct headset *headset_init(struct device *dev, sdp_record_t *record, +struct headset *headset_init(struct audio_device *dev, sdp_record_t *record, uint16_t svc); -void headset_free(struct device *dev); +void headset_free(struct audio_device *dev); uint32_t headset_config_init(GKeyFile *config); -void headset_update(struct device *dev, sdp_record_t *record, uint16_t svc); +void headset_update(struct audio_device *dev, sdp_record_t *record, uint16_t svc); -unsigned int headset_request_stream(struct device *dev, headset_stream_cb_t cb, - void *user_data); -gboolean headset_cancel_stream(struct device *dev, unsigned int id); +unsigned int headset_request_stream(struct audio_device *dev, + headset_stream_cb_t cb, void *user_data); +gboolean headset_cancel_stream(struct audio_device *dev, unsigned int id); -gboolean get_hfp_active(struct device *dev); -void set_hfp_active(struct device *dev, gboolean active); +gboolean get_hfp_active(struct audio_device *dev); +void set_hfp_active(struct audio_device *dev, gboolean active); -void headset_set_authorized(struct device *dev); -int headset_connect_rfcomm(struct device *dev, GIOChannel *chan); -int headset_close_rfcomm(struct device *dev); +void headset_set_authorized(struct audio_device *dev); +int headset_connect_rfcomm(struct audio_device *dev, GIOChannel *chan); +int headset_close_rfcomm(struct audio_device *dev); -headset_state_t headset_get_state(struct device *dev); -void headset_set_state(struct device *dev, headset_state_t state); +headset_state_t headset_get_state(struct audio_device *dev); +void headset_set_state(struct audio_device *dev, headset_state_t state); -int headset_get_channel(struct device *dev); +int headset_get_channel(struct audio_device *dev); -int headset_get_sco_fd(struct device *dev); +int headset_get_sco_fd(struct audio_device *dev); -gboolean headset_is_active(struct device *dev); +gboolean headset_is_active(struct audio_device *dev); -gboolean headset_lock(struct device *dev, headset_lock_t lock); -gboolean headset_unlock(struct device *dev, headset_lock_t lock); -gboolean headset_suspend(struct device *dev, void *data); -gboolean headset_play(struct device *dev, void *data); +gboolean headset_lock(struct audio_device *dev, headset_lock_t lock); +gboolean headset_unlock(struct audio_device *dev, headset_lock_t lock); +gboolean headset_suspend(struct audio_device *dev, void *data); +gboolean headset_play(struct audio_device *dev, void *data); diff --git a/audio/main.c b/audio/main.c index 6419da9a..2b9a1e95 100644 --- a/audio/main.c +++ b/audio/main.c @@ -34,24 +34,41 @@ #include <dbus/dbus.h> #include "plugin.h" -#include "dbus-service.h" +#include "../hcid/device.h" #include "logging.h" #include "unix.h" #include "device.h" #include "manager.h" -static const char *uuids[] = { - GENERIC_AUDIO_UUID, - HSP_HS_UUID, - HSP_AG_UUID, - HFP_HS_UUID, - HFP_AG_UUID, - ADVANCED_AUDIO_UUID, - A2DP_SOURCE_UUID, - A2DP_SINK_UUID, - AVRCP_REMOTE_UUID, - AVRCP_TARGET_UUID, - NULL +static DBusConnection *conn; + +static int audio_probe(const char *path) +{ + debug("path %s", path); + + return 0; +} + +static void audio_remove(const char *path) +{ + debug("path %s", path); +} + +static struct btd_device_driver audio_driver = { + .name = "audio", + .uuids = BTD_UUIDS( + GENERIC_AUDIO_UUID, + HSP_HS_UUID, + HSP_AG_UUID, + HFP_HS_UUID, + HFP_AG_UUID, + ADVANCED_AUDIO_UUID, + A2DP_SOURCE_UUID, + A2DP_SINK_UUID, + AVRCP_REMOTE_UUID, + AVRCP_TARGET_UUID), + .probe = audio_probe, + .remove = audio_remove, }; static GKeyFile *load_config_file(const char *file) @@ -71,8 +88,6 @@ static GKeyFile *load_config_file(const char *file) return keyfile; } -static DBusConnection *conn; - static int audio_init(void) { GKeyFile *config; @@ -96,14 +111,14 @@ static int audio_init(void) if (config) g_key_file_free(config); - register_service("audio", uuids); + btd_register_device_driver(&audio_driver); return 0; } static void audio_exit(void) { - unregister_service("audio"); + btd_unregister_device_driver(&audio_driver); audio_manager_exit(); diff --git a/audio/manager.c b/audio/manager.c index bf2b89ea..f6d26abd 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -83,7 +83,7 @@ typedef enum { } audio_sdp_state_t; struct audio_sdp_data { - struct device *device; + struct audio_device *device; DBusMessage *msg; /* Method call or NULL */ @@ -97,8 +97,8 @@ struct audio_sdp_data { static DBusConnection *connection = NULL; -static struct device *default_hs = NULL; -static struct device *default_dev = NULL; +static struct audio_device *default_hs = NULL; +static struct audio_device *default_dev = NULL; static GSList *devices = NULL; @@ -122,7 +122,7 @@ static struct enabled_interfaces enabled = { static DBusHandlerResult get_records(uuid_t *uuid, struct audio_sdp_data *data); -static struct device *create_device(const bdaddr_t *bda) +static struct audio_device *create_device(const bdaddr_t *bda) { static int device_id = 0; char path[128]; @@ -133,12 +133,12 @@ static struct device *create_device(const bdaddr_t *bda) return device_register(connection, path, bda); } -static void destroy_device(struct device *device) +static void destroy_device(struct audio_device *device) { dbus_connection_destroy_object_path(connection, device->path); } -static void remove_device(struct device *device) +static void remove_device(struct audio_device *device) { if (device == default_dev) { debug("Removing default device"); @@ -155,7 +155,7 @@ static void remove_device(struct device *device) destroy_device(device); } -static gboolean add_device(struct device *device, gboolean send_signals) +static gboolean add_device(struct audio_device *device, gboolean send_signals) { if (!send_signals) goto add; @@ -252,7 +252,7 @@ gboolean server_is_enabled(uint16_t svc) return ret; } -static void handle_record(sdp_record_t *record, struct device *device) +static void handle_record(sdp_record_t *record, struct audio_device *device) { gboolean is_default; uint16_t uuid16; @@ -432,7 +432,7 @@ static void get_records_cb(sdp_list_t *recs, int err, gpointer user_data) static DBusHandlerResult get_records(uuid_t *uuid, struct audio_sdp_data *data) { - struct device *device = data->device; + struct audio_device *device = data->device; int err; err = bt_search_service(&device->src, &device->dst, uuid, @@ -449,7 +449,7 @@ static DBusHandlerResult get_records(uuid_t *uuid, struct audio_sdp_data *data) } static DBusHandlerResult resolve_services(DBusMessage *msg, - struct device *device, + struct audio_device *device, create_dev_cb_t cb, void *user_data) { @@ -468,9 +468,9 @@ static DBusHandlerResult resolve_services(DBusMessage *msg, return get_records(&uuid, sdp_data); } -struct device *manager_device_connected(const bdaddr_t *bda, const char *uuid) +struct audio_device *manager_device_connected(const bdaddr_t *bda, const char *uuid) { - struct device *device; + struct audio_device *device; const char *path; gboolean headset = FALSE, created = FALSE; @@ -557,7 +557,7 @@ struct device *manager_device_connected(const bdaddr_t *bda, const char *uuid) gboolean manager_create_device(bdaddr_t *bda, create_dev_cb_t cb, void *user_data) { - struct device *dev; + struct audio_device *dev; dev = create_device(bda); if (!dev) @@ -574,7 +574,7 @@ static DBusHandlerResult am_create_device(DBusConnection *conn, { const char *address, *path; bdaddr_t bda; - struct device *device; + struct audio_device *device; DBusMessage *reply; DBusError derr; @@ -638,7 +638,7 @@ static DBusHandlerResult am_list_devices(DBusConnection *conn, DBUS_TYPE_STRING_AS_STRING, &array_iter); for (l = devices; l != NULL; l = l->next) { - struct device *device = l->data; + struct audio_device *device = l->data; if (hs_only && !device->headset) continue; @@ -654,7 +654,7 @@ static DBusHandlerResult am_list_devices(DBusConnection *conn, static gint device_path_cmp(gconstpointer a, gconstpointer b) { - const struct device *device = a; + const struct audio_device *device = a; const char *path = b; return strcmp(device->path, path); @@ -668,7 +668,7 @@ static DBusHandlerResult am_remove_device(DBusConnection *conn, DBusMessage *reply; GSList *match; const char *path; - struct device *device; + struct audio_device *device; dbus_error_init(&derr); if (!dbus_message_get_args(msg, &derr, @@ -747,7 +747,7 @@ static DBusHandlerResult am_find_by_addr(DBusConnection *conn, const char *address; DBusMessage *reply; DBusError derr; - struct device *device; + struct audio_device *device; bdaddr_t bda; dbus_error_init(&derr); @@ -808,7 +808,7 @@ static DBusHandlerResult am_change_default_device(DBusConnection *conn, DBusMessage *reply; GSList *match; const char *path; - struct device *device; + struct audio_device *device; dbus_error_init(&derr); if (!dbus_message_get_args(msg, &derr, @@ -893,7 +893,7 @@ static DBusSignalVTable manager_signals[] = { static void parse_stored_devices(char *key, char *value, void *data) { bdaddr_t *src = data; - struct device *device; + struct audio_device *device; bdaddr_t dst; if (!key || !value || strcmp(key, "default") == 0) @@ -927,7 +927,7 @@ static void register_devices_stored(const char *adapter) { char filename[PATH_MAX + 1]; struct stat st; - struct device *device; + struct audio_device *device; bdaddr_t default_src; bdaddr_t dst; bdaddr_t src; @@ -1182,7 +1182,7 @@ static sdp_record_t *hfp_ag_record(uint8_t ch, uint32_t feat) static void auth_cb(DBusError *derr, void *user_data) { - struct device *device = user_data; + struct audio_device *device = user_data; const char *uuid; if (get_hfp_active(device)) @@ -1230,7 +1230,7 @@ static void ag_io_cb(GIOChannel *chan, int err, const bdaddr_t *src, const bdaddr_t *dst, gpointer data) { const char *uuid; - struct device *device; + struct audio_device *device; gboolean hfp_active; if (err < 0) { @@ -1555,17 +1555,17 @@ void audio_manager_exit(void) connection = NULL; } -struct device *manager_default_device(void) +struct audio_device *manager_default_device(void) { return default_dev; } -struct device *manager_get_connected_device(void) +struct audio_device *manager_get_connected_device(void) { GSList *l; for (l = devices; l != NULL; l = g_slist_next(l)) { - struct device *device = l->data; + struct audio_device *device = l->data; if ((device->sink || device->source) && avdtp_is_connected(&device->src, &device->dst)) @@ -1647,7 +1647,7 @@ gboolean manager_authorize(const bdaddr_t *dba, const char *uuid, return TRUE; } -struct device *manager_find_device(const bdaddr_t *bda, const char *interface, +struct audio_device *manager_find_device(const bdaddr_t *bda, const char *interface, gboolean connected) { GSList *l; @@ -1656,7 +1656,7 @@ struct device *manager_find_device(const bdaddr_t *bda, const char *interface, return default_dev; for (l = devices; l != NULL; l = l->next) { - struct device *dev = l->data; + struct audio_device *dev = l->data; if (bacmp(bda, BDADDR_ANY) && bacmp(&dev->dst, bda)) continue; diff --git a/audio/manager.h b/audio/manager.h index b64708b8..6b2b90d8 100644 --- a/audio/manager.h +++ b/audio/manager.h @@ -34,17 +34,17 @@ struct enabled_interfaces { gboolean control; }; -typedef void (*create_dev_cb_t) (struct device *dev, void *user_data); +typedef void (*create_dev_cb_t) (struct audio_device *dev, void *user_data); int audio_manager_init(DBusConnection *conn, GKeyFile *config); void audio_manager_exit(void); gboolean server_is_enabled(uint16_t svc); -struct device *manager_find_device(const bdaddr_t *bda, const char *interface, +struct audio_device *manager_find_device(const bdaddr_t *bda, const char *interface, gboolean connected); -struct device *manager_device_connected(const bdaddr_t *bda, const char *uuid); +struct audio_device *manager_device_connected(const bdaddr_t *bda, const char *uuid); gboolean manager_create_device(bdaddr_t *bda, create_dev_cb_t cb, void *user_data); diff --git a/audio/sink.c b/audio/sink.c index af51a9c7..7f33cf13 100644 --- a/audio/sink.c +++ b/audio/sink.c @@ -76,7 +76,7 @@ static void stream_state_changed(struct avdtp_stream *stream, struct avdtp_error *err, void *user_data) { - struct device *dev = user_data; + struct audio_device *dev = user_data; struct sink *sink = dev->sink; if (err) @@ -382,7 +382,7 @@ failed: static DBusHandlerResult sink_connect(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *dev = data; + struct audio_device *dev = data; struct sink *sink = dev->sink; struct pending_request *pending; @@ -414,7 +414,7 @@ static DBusHandlerResult sink_connect(DBusConnection *conn, static DBusHandlerResult sink_disconnect(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct sink *sink = device->sink; struct pending_request *pending; int err; @@ -450,7 +450,7 @@ static DBusHandlerResult sink_is_connected(DBusConnection *conn, DBusMessage *msg, void *data) { - struct device *device = data; + struct audio_device *device = data; struct sink *sink = device->sink; DBusMessage *reply; dbus_bool_t connected; @@ -484,7 +484,7 @@ static DBusSignalVTable sink_signals[] = { { NULL, NULL } }; -struct sink *sink_init(struct device *dev) +struct sink *sink_init(struct audio_device *dev) { if (!dbus_connection_register_interface(dev->conn, dev->path, AUDIO_SINK_INTERFACE, @@ -495,7 +495,7 @@ struct sink *sink_init(struct device *dev) return g_new0(struct sink, 1); } -void sink_free(struct device *dev) +void sink_free(struct audio_device *dev) { struct sink *sink = dev->sink; @@ -516,7 +516,7 @@ void sink_free(struct device *dev) dev->sink = NULL; } -gboolean sink_is_active(struct device *dev) +gboolean sink_is_active(struct audio_device *dev) { struct sink *sink = dev->sink; @@ -526,14 +526,14 @@ gboolean sink_is_active(struct device *dev) return FALSE; } -avdtp_state_t sink_get_state(struct device *dev) +avdtp_state_t sink_get_state(struct audio_device *dev) { struct sink *sink = dev->sink; return sink->state; } -gboolean sink_new_stream(struct device *dev, struct avdtp *session, +gboolean sink_new_stream(struct audio_device *dev, struct avdtp *session, struct avdtp_stream *stream) { struct sink *sink = dev->sink; diff --git a/audio/sink.h b/audio/sink.h index fb9391df..5e4b6aaa 100644 --- a/audio/sink.h +++ b/audio/sink.h @@ -24,9 +24,9 @@ #define AUDIO_SINK_INTERFACE "org.bluez.audio.Sink" -struct sink *sink_init(struct device *dev); -void sink_free(struct device *dev); -gboolean sink_is_active(struct device *dev); -avdtp_state_t sink_get_state(struct device *dev); -gboolean sink_new_stream(struct device *dev, struct avdtp *session, +struct sink *sink_init(struct audio_device *dev); +void sink_free(struct audio_device *dev); +gboolean sink_is_active(struct audio_device *dev); +avdtp_state_t sink_get_state(struct audio_device *dev); +gboolean sink_new_stream(struct audio_device *dev, struct avdtp *session, struct avdtp_stream *stream); diff --git a/audio/unix.c b/audio/unix.c index 05ac448a..93f5788b 100644 --- a/audio/unix.c +++ b/audio/unix.c @@ -57,7 +57,7 @@ typedef enum { TYPE_SOURCE } service_type_t; -typedef void (*notify_cb_t) (struct device *dev, void *data); +typedef void (*notify_cb_t) (struct audio_device *dev, void *data); struct a2dp_data { struct avdtp *session; @@ -70,7 +70,7 @@ struct headset_data { }; struct unix_client { - struct device *dev; + struct audio_device *dev; GSList *caps; service_type_t type; char *interface; @@ -83,7 +83,7 @@ struct unix_client { int data_fd; /* To be deleted once two phase configuration is fully implemented */ unsigned int req_id; unsigned int cb_id; - gboolean (*cancel) (struct device *dev, unsigned int id); + gboolean (*cancel) (struct audio_device *dev, unsigned int id); }; static GSList *clients = NULL; @@ -173,7 +173,7 @@ static void unix_ipc_error(struct unix_client *client, int type, int err) unix_ipc_sendmsg(client, &rsp_hdr->msg_h); } -static service_type_t select_service(struct device *dev, const char *interface) +static service_type_t select_service(struct audio_device *dev, const char *interface) { if (!interface) { if (dev->sink && avdtp_is_connected(&dev->src, &dev->dst)) @@ -220,7 +220,7 @@ static void stream_state_changed(struct avdtp_stream *stream, } } -static void headset_discovery_complete(struct device *dev, void *user_data) +static void headset_discovery_complete(struct audio_device *dev, void *user_data) { struct unix_client *client = user_data; char buf[BT_AUDIO_IPC_PACKET_SIZE]; @@ -247,7 +247,7 @@ failed: client->dev = NULL; } -static void headset_setup_complete(struct device *dev, void *user_data) +static void headset_setup_complete(struct audio_device *dev, void *user_data) { struct unix_client *client = user_data; char buf[BT_AUDIO_IPC_PACKET_SIZE]; @@ -298,7 +298,7 @@ failed: client->dev = NULL; } -static void headset_resume_complete(struct device *dev, void *user_data) +static void headset_resume_complete(struct audio_device *dev, void *user_data) { struct unix_client *client = user_data; char buf[BT_AUDIO_IPC_PACKET_SIZE]; @@ -554,7 +554,7 @@ failed: a2dp->stream = NULL; } -static void start_discovery(struct device *dev, struct unix_client *client) +static void start_discovery(struct audio_device *dev, struct unix_client *client) { struct a2dp_data *a2dp; int err = 0; @@ -596,7 +596,7 @@ failed: unix_ipc_error(client, BT_GETCAPABILITIES_RSP, err ? : EIO); } -static void start_config(struct device *dev, struct unix_client *client) +static void start_config(struct audio_device *dev, struct unix_client *client) { struct a2dp_data *a2dp; unsigned int id; @@ -644,7 +644,7 @@ failed: unix_ipc_error(client, BT_SETCONFIGURATION_RSP, EIO); } -static void start_resume(struct device *dev, struct unix_client *client) +static void start_resume(struct audio_device *dev, struct unix_client *client) { struct a2dp_data *a2dp; unsigned int id; @@ -694,7 +694,7 @@ failed: unix_ipc_error(client, BT_STREAMSTART_RSP, EIO); } -static void start_suspend(struct device *dev, struct unix_client *client) +static void start_suspend(struct audio_device *dev, struct unix_client *client) { struct a2dp_data *a2dp; unsigned int id; @@ -744,7 +744,7 @@ failed: unix_ipc_error(client, BT_STREAMSTOP_RSP, EIO); } -static void create_cb(struct device *dev, void *user_data) +static void create_cb(struct audio_device *dev, void *user_data) { struct unix_client *client = user_data; @@ -757,7 +757,7 @@ static void create_cb(struct device *dev, void *user_data) static void handle_getcapabilities_req(struct unix_client *client, struct bt_getcapabilities_req *req) { - struct device *dev; + struct audio_device *dev; bdaddr_t bdaddr; str2ba(req->device, &bdaddr); @@ -888,7 +888,7 @@ static int handle_a2dp_transport(struct unix_client *client, static void handle_setconfiguration_req(struct unix_client *client, struct bt_setconfiguration_req *req) { - struct device *dev; + struct audio_device *dev; bdaddr_t bdaddr; int err = 0; |