diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-08-04 17:04:21 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-08-29 12:42:58 -0700 |
commit | b798cec4ca623095c57fcba73148fb955db3b096 (patch) | |
tree | e11dbd319f7f3b8dbde12010a75f1eef6f915342 /src/device.c | |
parent | d7b78586afddeedb7759255707e3fb709c478a5e (diff) | |
download | bluez-b798cec4ca623095c57fcba73148fb955db3b096.tar.gz |
shared/bap: Add initial code for handling BAP
This adds initial code for Basic Audio Profile.
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c index 44b903335..995d39f2c 100644 --- a/src/device.c +++ b/src/device.c @@ -3731,9 +3731,12 @@ static void device_add_gatt_services(struct btd_device *device) static void device_accept_gatt_profiles(struct btd_device *device) { GSList *l; + bool initiator = get_initiator(device); + + DBG("initiator %s", initiator ? "true" : "false"); for (l = device->services; l != NULL; l = g_slist_next(l)) - service_accept(l->data, get_initiator(device)); + service_accept(l->data, initiator); } static void device_remove_gatt_service(struct btd_device *device, @@ -5424,6 +5427,9 @@ int device_connect_le(struct btd_device *dev) DBG("Connection attempt to: %s", addr); + /* Set as initiator */ + dev->le_state.initiator = true; + if (dev->le_state.paired) sec_level = BT_IO_SEC_MEDIUM; else @@ -5461,8 +5467,6 @@ int device_connect_le(struct btd_device *dev) /* Keep this, so we can cancel the connection */ dev->att_io = io; - /* Set as initiator */ - dev->le_state.initiator = true; return 0; } |