From 5fbba47811028347ce2fd925680d28ea56a00e6e Mon Sep 17 00:00:00 2001 From: Lukasz Rymanowski Date: Tue, 2 Sep 2014 12:09:58 +0200 Subject: [PATCH] android/gatt: Move auto_connect_le() up in the file Move function up in the file. Will be needed by following patches. --- android/gatt.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index 1f746a27d..aff5dc5c5 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -582,6 +582,23 @@ static void device_set_state(struct gatt_device *dev, uint32_t state) dev->state = state; } +static bool auto_connect_le(struct gatt_device *dev) +{ + /* For LE devices use auto connect feature if possible */ + if (bt_kernel_conn_control()) + return bt_auto_connect_add(&dev->bdaddr); + + /* Trigger discovery if not already started */ + if (!scanning) { + if (!bt_le_discovery_start()) { + error("gatt: Could not start scan"); + return false; + } + } + + return true; +} + static void connection_cleanup(struct gatt_device *device) { if (device->watch_id) { @@ -1813,23 +1830,6 @@ static int connect_bredr(struct gatt_device *dev) return 0; } -static bool auto_connect_le(struct gatt_device *dev) -{ - /* For LE devices use auto connect feature if possible */ - if (bt_kernel_conn_control()) - return bt_auto_connect_add(&dev->bdaddr); - - /* Trigger discovery if not already started */ - if (!scanning) { - if (!bt_le_discovery_start()) { - error("gatt: Could not start scan"); - return false; - } - } - - return true; -} - static bool trigger_connection(struct app_connection *connection) { bool ret; -- 2.47.3