RoverSocket class

A UDP socket fit for use on the rover, with heartbeats, logging, and settings included.

Inheritance
Mixed-in types

Constructors

RoverSocket({required int? port, required Device device, SocketInfo? destination, bool quiet, bool keepDestination, Service? collection})

Properties

collection ↔ Service?
The main service, or collection of services, of the program, if any.
getter/setter pairinherited
destination ↔ SocketInfo?
The destination port to send to.
getter/setter pairinherited
device → Device
The device this socket will be used on.
finalinherited
didReceivedHeartbeat ↔ bool
Whether this socket received a heartbeat since the last call to checkHeartbeats.
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
heartbeatInterval → Duration
How often to check for new heartbeats.
no setterinherited
isConnected → bool
Whether the device on the other end is connected.
no setterinherited
keepDestination → bool
Whether or not the default destination should be kept when the socket is dispose.
finalinherited
logger → BurtLogger
A logger to capture important events during operation.
finalinherited
messages → Stream<WrappedMessage>
A stream of WrappedMessages as they arrive in the UDP socket.
no setterinherited
port → int?
The port this socket is listening on. See RawDatagramSocket.bind.
no setterinherited
quiet → bool
Whether to silence "normal" output, like opening/closing and resetting sockets.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stream → Stream<Datagram>
A stream containing all the data coming out of the socket.
no setterinherited

Methods

checkHeartbeats() → Future<void>
Checks if a heartbeat has been received. If not, calls onDisconnect.
inherited
dispose() → Future<void>
Closes the connection to the device.
inherited
init() → Future<bool>
Initializes the connection to the device.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onConnect(SocketInfo source) → void
Sets destination to the incoming source.
inherited
onDisconnect() → Future<void>
Sends a Disconnect message to the dashboard and sets destination to null.
inherited
onHeartbeat(Heartbeat heartbeat, SocketInfo source) → void
Handles incoming heartbeats.
inherited
onSettings(UpdateSetting settings) → Future<void>
Handles an UpdateSetting command and updates the appropriate setting.
inherited
restart() → Future<void>
Restarts this program, usually by disposing and re-initializing the collection.
inherited
send(List<int> data, {SocketInfo? destination}) → void
Sends data to the given destination.
inherited
sendHeartbeatResponse() → void
Responds to an incoming heartbeat.
inherited
sendLog(BurtLog log) → void
Sends a log message or saves it until a Dashboard is connected.
inherited
sendMessage(Message message, {SocketInfo? destination}) → void
Sends a Message over the socket (in a WrappedMessage).
inherited
sendWrapper(WrappedMessage wrapper, {SocketInfo? destination}) → void
Sends a WrappedMessage over the socket.
inherited
toString() → String
A string representation of this object.
inherited
tryHandshake<T extends Message>({required T message, required Duration timeout, required T constructor(List<int> bytes), SocketInfo? destination}) → Future<bool>
A utility method to exchange a "handshake" to the destination
inherited
waitForConnection() → Future<void>
Waits for a connection to be established.
inherited

Operators

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