connect method
Connects to a device
Implementation
Future<bool> connect(String address) async {
if (_connectionState == BluetoothConnectionState.connected || _connectionState == BluetoothConnectionState.connecting) {
return false;
}
_updateConnectionState(BluetoothConnectionState.connecting);
try {
return await _channel.invokeMethod('connect', {'address': address});
} catch (e) {
_updateConnectionState(BluetoothConnectionState.error);
return false;
}
}