FakeRfcommTransport class

A controllable RfcommTransport for tests.

Implemented types

Constructors

FakeRfcommTransport({required DeviceId device, required int? channel, required Uuid serviceUuid})

Properties

channel int?
The channel passed to openRfcomm (null if SDP-resolved).
final
device DeviceId
Which device this transport was opened for.
final
flushCount int
Number of times flush was awaited.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
incoming Stream<Uint8List>
Inbound bytes. Single-subscription; closes on disconnect (clean EOF).
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sent List<Uint8List>
Everything written via send, in order.
final
serviceUuid Uuid
The service UUID requested.
final
state ConnectionState
Current state.
no setteroverride
stateChanges Stream<ConnectionState>
Connection-state transitions for this channel.
no setteroverride

Methods

close() Future<void>
Closes the channel. Idempotent.
override
deliver(List<int> bytes) → void
Pushes bytes to the connection's input stream as if received.
dropPeer() → void
Simulates the peer dropping the link. Mirrors real backends, which close both the state and incoming streams on a peer-initiated disconnect.
flush() Future<void>
Completes when all queued bytes have been handed to the OS.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(Uint8List data) → void
Queues data for transmission. Must return immediately without blocking; the platform drains the queue off the calling isolate.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited