BrilliantDevice class

Constructors

BrilliantDevice({required BrilliantConnectionState state, required BluetoothDevice device, int? maxStringLength, int? maxDataLength, BrilliantDeviceType type = BrilliantDeviceType.unknown})

Properties

audioTxChannel ↔ BluetoothCharacteristic?
getter/setter pair
connectionState Stream<BrilliantDevice>
no setter
dataResponse Stream<List<int>>
no setter
device ↔ BluetoothDevice
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
maxDataLength int?
getter/setter pair
maxStringLength int?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
rxChannel ↔ BluetoothCharacteristic?
getter/setter pair
state BrilliantConnectionState
getter/setter pair
stringResponse Stream<String>
no setter
txChannel ↔ BluetoothCharacteristic?
getter/setter pair
type BrilliantDeviceType
getter/setter pair
uuid String
no setter

Methods

clearDisplay() Future<void>
disconnect() Future<void>
isLuaInReplState({Duration timeout = const Duration(milliseconds: 200)}) Future<bool>
Checks if Lua is in the REPL/break by sending a simple print command and expecting a response. If Lua is in the REPL/break state, it will respond with the printed output and we return true. If a Lua main loop is running, it will not respond to the print command within the short timeout, and we return false.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendAudio(Uint8List data, {bool awaitBtResponse = false}) Future<void>
sendBreakSignal() Future<void>
sendData(List<int> data, {bool awaitBtResponse = true, Duration timeout = const Duration(seconds: 5)}) Future<void>
sendDataRaw(Uint8List data, {bool awaitBtResponse = true, Duration timeout = const Duration(seconds: 5)}) Future<void>
sendDataRawOnCharacteristic(Uint8List data, BluetoothCharacteristic char, {bool awaitBtResponse = true, bool awaitAppResponse = true, bool validateHeader = true, Duration timeout = const Duration(seconds: 5)}) Future<void>
Same as sendData but user includes the 0x01 header byte to avoid extra memory allocation awaitBtResponse indicates whether to wait for a bluetooth-level ack from the write operation (write-without-response/write-with-response) awaitAppResponse indicates whether to wait for an application-level ack from the data handler on the device validateHeader indicates whether to check that the first byte is 0x01 (true for data tx, false for audio) timeout indicates how long to wait for the application-level ack before timing out
sendMessage(int msgCode, Uint8List payload, {bool awaitBtResponse = true}) Future<void>
Sends a typed message as a series of messages to Frame as chunks marked by [0x01 (dataFlag), messageFlag & 0xFF, {first packet: length(Uint16)}, payload(chunked)] until all data in the payload is sent. Payload data cannot exceed 65535 bytes in length. Can be received by a corresponding Lua function on Frame.
sendRemoveSignal() Future<void>
sendResetSignal() Future<void>
sendString(String string, {bool awaitResponse = true, bool log = true, Duration timeout = const Duration(seconds: 10)}) Future<String?>
toString() String
A string representation of this object.
inherited
uploadScript(String fileName, String fileContents) Future<void>

Operators

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