UrpVirtualStrategy class
- Inheritance
-
- Object
- ChangeNotifier
- UrpVirtualStrategy
Constructors
-
UrpVirtualStrategy(Future<
UrpResponse?> onRequest(UrpRequest request))
Properties
-
availability
→ Future<
StrategyAvailability> -
Get the availability of the strategy
no setter
- availabilityNow → dynamic
-
no setter
- debugFailConnection ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- name → String
-
The name of the strategy, e.g. 'Bluetooth', 'WiFi'
no setter
- onConnectCallback ↔ void Function()?
-
Callback when the device is connected
getter/setter pairinherited
- onDisconnectCallback ↔ void Function()?
-
Callback when the device is disconnected
getter/setter pairinherited
-
onRequest
↔ Future<
UrpResponse?> Function(UrpRequest request) -
getter/setter pair
- pingDeviceCallback ↔ void Function()?
-
Callback when the device is pinged
getter/setter pairinherited
- powerState ↔ UrpPowerState?
-
The power state of a device
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- simulateDelays ↔ bool
-
getter/setter pair
- status → ConnectionStatus
-
The current connection status
no setterinherited
-
statusStream
→ Stream<
ConnectionStatus> -
The current status as stream
no setterinherited
-
virtualReaders
→ List<
FoundDevice> -
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addQueue(
Uint8List command, UrpDeviceIdentifier target, UrpDeviceIdentifier origin, {Duration? timeout}) → Future< UrpResponse> - Adds a command to the queue.
-
clearVirtualReaders(
) → void -
connectToFoundDevice(
FoundDevice reader) → Future< bool> -
Connect to a
FoundDevice
that was previously found during a searchinherited -
createVirtualReader(
FoundDevice reader) → void - Add a virtual reader to the list of found readers
-
debugSetConnectionStatus(
ConnectionStatus status) → void - Manually set the connection status
-
delay(
Duration duration) → Future< void> -
disconnectDevice(
) → Future< void> -
Disconnect the reader, cancels all pending commands
with a
DeviceDisconnectedException
inherited -
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
findAndConnectDevice(
{required Set< UrpDeviceType> readerTypes, String? deviceAddress}) → Future<bool> -
Returns
true
if the connection was successful,false
otherwise. Will run findDevices and connect to the first reader found. -
findDevices(
Set< UrpDeviceType> readerTypes) → Stream<FoundDevice> -
Will return a stream of
FoundDevice
s that match thereaderTypes
provided. Will wait 1 second before starting to emit the readers. Will wait 300 milliseconds between emitting each reader. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onConnect(
void callback()) → void -
Set callback when the device is connected
inherited
-
onData(
Uint8List input) → void -
called by the strategy when raw data is received
inherited
-
onDisconnect(
void callback()) → void -
Set callback when the device is disconnected
inherited
-
onPing(
void callback()) → void -
Set callback when the device is pinged
inherited
-
output(
Uint8List bytes) → void - Output bytes to the deivce
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
replyFromVirtualDevice(
int seqNr, UrpResponse response) → void -
setAvailability(
StrategyAvailability availability) → void -
setStatus(
ConnectionStatus status) → void -
Set the current connection status
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited