BrilliantDevice class

Class representing a Brilliant device.

Constructors

BrilliantDevice({required BrilliantConnectionState state, required BluetoothDevice device, int? maxStringLength, int? maxDataLength, Duration defaultTimeout = const Duration(seconds: 30), bool logDebugging = false})

Properties

connectionState → Stream<BrilliantDevice>
Stream of connection state changes for the device.
no setter
dataResponse → Stream<Uint8List>
Stream of data responses from the device.
no setter
defaultTimeout ↔ Duration
getter/setter pair
device ↔ BluetoothDevice
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id → String
Returns the device ID.
no setter
isConnected → bool
Checks if the device is connected.
no setter
logDebugging ↔ bool
getter/setter pair
maxDataLength ↔ int?
getter/setter pair
maxReceiveBuffer ↔ int
getter/setter pair
maxStringLength ↔ int?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state ↔ BrilliantConnectionState
getter/setter pair
stringResponse → Stream<String>
Stream of string responses from the device.
no setter

Methods

disconnect() → Future<void>
Disconnects the device.
getDataOfType(FrameDataTypePrefixes dataType) → Stream<Uint8List>
Gets data of a specific type from the device.
getDataWithPrefix(int prefix) → Stream<Uint8List>
Gets data of a specific type from the device.
handleDataResponsePart(Stream<OnCharacteristicReceivedEvent> source) → Stream<Uint8List>
Handles data response parts from the device.
handleStringResponsePart(Stream<OnCharacteristicReceivedEvent> source) → Stream<String>
Handles string response parts from the device.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendBreakSignal() → Future<void>
Sends a break signal to the device.
sendData(Uint8List data, {bool awaitResponse = false, Duration? timeout}) → Future<Uint8List?>
Sends data to the device.
sendResetSignal() → Future<void>
Sends a reset signal to the device.
sendString(String string, {bool awaitResponse = false, Duration? timeout}) → Future<String?>
Sends a string to the device.
toString() → String
A string representation of this object.
inherited
updateFirmware(String filePath) → Stream<double>
Updates the firmware of the device.
uploadScript(String fileName, String filePath) → Future<void>
Uploads a script to the device.
waitForData({Duration? timeout}) → Future<Uint8List>
Waits for any data from the device.
waitForDataOfType(FrameDataTypePrefixes dataType, {Duration? timeout}) → Future<Uint8List>
Waits for data of a specific type from the device.
waitForString({String? match, Duration? timeout}) → Future<String>
Waits for a specific string from the device.

Operators

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