udp library
The shared Dart networking library.
We use UDP to send data to and from the rover. In order to sync our data between languages, we use Protobuf. Because UDP is inherently unsafe, we have a "heartbeat" and "handshake" protocol.
This library offers several classes to help use UDP sockets consistently:
- UdpSocket is a raw UDP socket that allows sending and receiving lists of bytes.
- BurtSocket uses a UdpSocket to add Protobuf, heartbeats, and settings.
- RoverHeartbeats extends BurtSocket to respond to the dashboard's heartbeats.
RoverLogger
extends BurtSocket by buffering logs until the dashboard connects.- RoverSocket combines RoverHeartbeats and
RoverLogger
to handle all on-rover needs.
On the rover, use RoverSocket. On the dashboard, extend BurtSocket. To use these classes, extend them and override the suggested methods in their respective documentation. You should not have to use UdpSocket directly as it has no Protobuf support.
Classes
- BurtSocket
- A UdpSocket that follows the BURT protocols.
- RoverSocket
- A UDP socket fit for use on the rover, with heartbeats, logging, and settings included.
- SocketInfo
- Information about a socket.
- UdpSocket
- Manages a UDP socket.
Mixins
- RoverHeartbeats
- A mixin that automatically handles rover-side heartbeats.
- RoverSettings
- A mixin that handles UpdateSetting commands.
Typedefs
- Heartbeat = Connect
- A better name for Connect.
- NetworkSettings = UpdateSetting
- A better name for UpdateSetting.