BurtFirmwareSerial class
Represents a firmware device connected over Serial.
This device starts with an unknown device. Calling init starts a handshake with the device that identifies it. If the handshake fails, isReady will be false. Calling dispose will reset the device and close the connection.
Constructors
- BurtFirmwareSerial({required String port, required BurtLogger logger, int baudRate = 9600})
- Creates a firmware device with the given serial port and baud rate.
Properties
- device ↔ Device
-
The name of this device.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isReady → bool
-
Whether this device has passed the handshake.
no setter
- logger → BurtLogger
-
The logger to use.
final
-
messages
→ Stream<
WrappedMessage> -
The stream of incoming messages, wrapped into WrappedMessages.
no setter
- port → String
-
The port this device is attached to.
no setter
-
rawStream
→ Stream<
Uint8List> -
The stream of raw data coming from this device.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> -
Resets the device and closes the port.
override
-
init(
) → Future< bool> -
Initializes the connection to the device.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDisconnect(
) → Future< void> -
A callback to run when the program has disconnected from the Dashboard.
inherited
-
sendBytes(
List< int> bytes) → void - Sends bytes to the device.
-
sendMessage(
Message message) → void - Sends a Protobuf message to the device.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
Constants
- handshakeDelay → const Duration
- How long it should take for a firmware device to respond to a handshake.
- readInterval → const Duration
- The interval to read serial data at.