Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

BinghamtonRover/Networking

Repository files navigation

BURT Networking (Dart)

Note

This repository has moved to our mono-repo as of BinghamtonRover/Rover-Code#4

A Dart library for UDP communication, featuring our Protobuf data and our heartbeat + handshake protocol.

See the docs for details.

Usage

Use the RoverSocket class to handle messages, heartbeats, and logs from the rover. On the Dashboard, subclass BurtSocket.

import "package:burt_network/burt_network.dart";

void main() async {
  final socket = RoverSocket(port: 8001, device: Device.SUBSYSTEMS);
  socket.messages.onMessage(
    name: ScienceData().messageName,
    constructor: ScienceData.fromBuffer,
    callback: (data) => print(data.co2),
  );
}