testing library

In-memory fake backend for testing apps that use bluetooth_rfcomm without real hardware.

final fake = FakeBluetoothRfcommPlatform()
  ..bonded.add(FakeBluetoothRfcommPlatform.sampleDevice());
final bt = BluetoothRfcomm(platform: fake);

Classes

FakeBluetoothRfcommPlatform
A scriptable, in-memory BluetoothRfcommPlatform for tests.
FakeRfcommTransport
A controllable RfcommTransport for tests.

Functions

checkRfcommTransportConformance({required Future<RfcommTransport> open(), Future<void> simulatePeerDrop(RfcommTransport transport)?, Future<void> injectIncoming(RfcommTransport transport, Uint8List bytes)?}) Future<List<String>>
Contract-conformance checker for RfcommTransport implementations.