summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-03-09 14:20:17 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-03-09 16:33:02 -0800
commit1033a462377d9374e9240878357620a8ad368bbf (patch)
treefc5e8757a0947d60883080b82d142dc4bdf55a26 /src/device.c
parentab3ff0d2cd5aab8bde5a99cf76e4771eefa7f7a0 (diff)
downloadbluez-1033a462377d9374e9240878357620a8ad368bbf.tar.gz
gatt: Use DEFER_SETUP for EATT channels
This makes use of DEFER_SETUP mechanism to do the following checks before accepting the connection: - Checks a valid device object exits - Checks if initiator/central as if the peripheral start connecting it may cause collisions. - Checks if the limit of allowed connections has been reached.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c
index 2b8e06c91..326a4d46a 100644
--- a/src/device.c
+++ b/src/device.c
@@ -294,7 +294,7 @@ static struct bearer_state *get_state(struct btd_device *dev,
return &dev->le_state;
}
-static bool get_initiator(struct btd_device *dev)
+bool btd_device_is_initiator(struct btd_device *dev)
{
if (dev->le_state.connected)
return dev->le_state.initiator;
@@ -3711,7 +3711,7 @@ done:
}
/* Notify driver about the new connection */
- service_accept(service, get_initiator(device));
+ service_accept(service, btd_device_is_initiator(device));
}
static void device_add_gatt_services(struct btd_device *device)
@@ -3731,7 +3731,7 @@ 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);
+ bool initiator = btd_device_is_initiator(device);
DBG("initiator %s", initiator ? "true" : "false");