Created
May 13, 2020 14:56
-
-
Save epietrowicz/9410053acabaa6a337376f67bd68401d to your computer and use it in GitHub Desktop.
connector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void _connectDevice(BluetoothDevice device) async { | |
flutterBlue.stopScan(); | |
try { | |
await device.connect(); | |
} catch (e) { | |
if (e.code != 'already_connected') { | |
throw e; | |
} | |
} finally { | |
List<BluetoothService> services = await device.discoverServices(); | |
_getLEDChar(services); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment