connect method
Initiates a connection to a BLE peripheral and returns a Stream representing the connection state.
Implementation
@override
Future<Stream<BleConnectionState>> connect({required String deviceAddress}) async {
final StreamController<BleConnectionState> controller = StreamController<BleConnectionState>.broadcast();
_connectionControllers[deviceAddress] = controller;
// Add the initial connection state, or default to disconnected if not set.
final BleConnectionState initialState = _connectionStates[deviceAddress] ?? BleConnectionState.disconnected;
controller.add(initialState);
return controller.stream;
}