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 c614e6a..9b58644 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -594,6 +594,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) { @@ -1825,23 +1842,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; -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html