Home | History | Annotate | Download | only in audio

Lines Matching full:device

53 #include "../src/device.h"
58 #include "device.h"
160 static void handle_uuid(const char *uuidstr, struct audio_device *device)
177 if (!server_is_enabled(&device->src, uuid16)) {
185 if (device->headset)
186 headset_update(device, uuid16, uuidstr);
188 device->headset = headset_init(device, uuid16,
196 if (device->headset)
197 headset_update(device, uuid16, uuidstr);
199 device->headset = headset_init(device, uuid16,
204 if (enabled.gateway && (device->gateway == NULL))
205 device->gateway = gateway_init(device);
209 if (device->sink == NULL)
210 device->sink = sink_init(device);
214 if (device->source == NULL)
215 device->source = source_init(device);
221 if (device->control)
222 control_update(device, uuid16);
224 device->control = control_init(device, uuid16);
225 if (device->sink && sink_is_active(device))
226 avrcp_connect(device);
419 struct audio_device *device = user_data;
423 if (device->hs_preauth_id) {
424 g_source_remove(device->hs_preauth_id);
425 device->hs_preauth_id = 0;
430 headset_set_state(device, HEADSET_STATE_DISCONNECTED);
434 io = headset_get_rfcomm(device);
436 if (!bt_io_accept(io, headset_connect_cb, device, NULL, &err)) {
439 headset_set_state(device, HEADSET_STATE_DISCONNECTED);
447 struct audio_device *device = user_data;
451 audio_device_cancel_authorization(device, headset_auth_cb, device);
453 headset_set_state(device, HEADSET_STATE_DISCONNECTED);
455 device->hs_preauth_id = 0;
463 struct audio_device *device;
491 device = manager_get_device(&src, &dst, TRUE);
492 if (!device)
495 if (!manager_allow_headset_connection(device)) {
500 if (!device->headset) {
501 btd_device_add_uuid(device->btd_dev, remote_uuid);
502 if (!device->headset)
506 if (headset_get_state(device) > HEADSET_STATE_DISCONNECTED) {
511 set_hfp_active(device, hfp_active);
513 if (headset_connect_rfcomm(device, chan) < 0) {
518 headset_set_state(device, HEADSET_STATE_CONNECTING);
520 perr = audio_device_request_authorization(device, server_uuid,
521 headset_auth_cb, device);
524 headset_set_state(device, HEADSET_STATE_DISCONNECTED);
528 device->hs_preauth_id = g_io_add_watch(chan,
530 hs_preauth_cb, device);
532 device->auto_connect = auto_connect;
542 struct audio_device *device = user_data;
549 ba2str(&device->dst, ag_address);
551 ag_address, device->path);
553 gateway_start_service(device);
563 struct audio_device *device;
581 device = manager_get_device(&src, &dst, TRUE);
582 if (!device)
585 if (!device->gateway) {
586 btd_device_add_uuid(device->btd_dev, remote_uuid);
587 if (!device->gateway)
591 if (gateway_is_connected(device)) {
596 if (gateway_connect_rfcomm(device, chan) < 0) {
601 perr = audio_device_request_authorization(device, server_uuid,
602 gateway_auth_cb, device);
771 static int audio_probe(struct btd_device *device, GSList *uuids)
773 struct btd_adapter *adapter = device_get_adapter(device);
778 device_get_address(device, &dst);
782 DBG("unable to get a device object");
791 static void audio_remove(struct btd_device *device)
796 path = device_get_path(device);
1335 struct btd_device *device;
1357 device = adapter_get_device(connection, adapter, addr);
1358 if (!device) {
1363 path = device_get_path(device);
1365 dev = audio_device_register(connection, device, path, src, dst);
1374 gboolean manager_allow_headset_connection(struct audio_device *device)
1383 if (dev == device)
1386 if (bacmp(&dev->src, &device->src))