Diff between 56043c996c002de6db94bbc60788965a06ee2f9b and 5fbba47811028347ce2fd925680d28ea56a00e6e

Changed Files

File Additions Deletions Status
android/gatt.c +17 -17 modified

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index 1f746a2..aff5dc5 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;