openRfcomm method

  1. @override
Future<RfcommTransport> openRfcomm(
  1. DeviceId device, {
  2. int? channel,
  3. required Uuid serviceUuid,
  4. Duration? timeout,
})
override

Opens an RFCOMM channel to device id. If channel is given it is used verbatim; otherwise the channel is resolved from SDP for serviceUuid.

Implementation

@override
Future<RfcommTransport> openRfcomm(
  DeviceId device, {
  int? channel,
  required Uuid serviceUuid,
  Duration? timeout,
}) async {
  final err = connectError;
  if (err != null) throw err;
  final t = FakeRfcommTransport(
    device: device,
    channel: channel,
    serviceUuid: serviceUuid,
  );
  transports.add(t);
  return t;
}