OSDN Git Service

android/gatt: Restart scan after connection
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>
Sun, 23 Mar 2014 20:20:09 +0000 (21:20 +0100)
committerSzymon Janc <szymon.janc@tieto.com>
Mon, 24 Mar 2014 13:03:57 +0000 (14:03 +0100)
With this patch we make sure that scan is restarted if it was holded for
connection purpose.

android/gatt.c

index ee9eb90..813588b 100644 (file)
@@ -481,6 +481,12 @@ reply:
        /* If connection did not succeed, destroy device */
        if (status)
                destroy_device(dev);
+
+       /* Check if we should restart scan */
+       if (scanning)
+               bt_le_discovery_start(le_device_found_handler);
+
+       /*FIXME: What to do if discovery won't start here. */
 }
 
 static int connect_le(struct gatt_device *dev)