Package-level declarations

NT4Server, a NetworkTables 4 server that dashboards such as AdvantageScope and Glass connect to. Publish a topic, set values on it, and subscribed clients are sent the topics they asked for, their current values, and every change after that. NT4Type names the types of the values it can publish.

It is publish-only: clients can read but not write. It supports the 4.1 and 4.0 protocols and the RTT subprotocol, answers the clock-synchronization messages clients use, and publishes struct schemas as the /.schema/ topics AdvantageScope reads. A client that falls too far behind is disconnected so it can reconnect and catch up, instead of the robot waiting on it. It sends every change whatever a subscription's periodic option says, and it has no $ meta topics.

A topic name keeps its type for as long as the server object exists, even after the topic is unpublished. Dashboards such as AdvantageScope key a field by name and keep its first type, and show a "Conflicting types" error for values of another, so the server refuses the new type and telemetry warns. A name can be published again with the type it had, which is what each OpMode does when its backend publishes the same topics again.

Struct schemas

Struct schemas (StructSchema, StructSchemaRegistry and the Struct* annotations) come from dev.nextftc.util.struct in the util module. The same schema works for both the log writer and the server.

Types

Link copied to clipboard
class NT4Backend @JvmOverloads constructor(val server: NT4Server, stopServerOnClose: Boolean = false) : TelemetryBackend

Publishes logged values to an NT4Server, one topic per path.

Link copied to clipboard
class NT4Server @JvmOverloads constructor(val port: Int = DEFAULT_PORT, val host: String = "0.0.0.0", timeSource: TimeSource.WithComparableMarks = TimeSource.Monotonic, val origin: ComparableTimeMark = timeSource.markNow(), routes: Routing.() -> Unit? = null) : Closeable

A NetworkTables 4 server that publishes values to dashboards such as AdvantageScope, Glass and Shuffleboard.

Link copied to clipboard

The NetworkTables 4 types for the values NT4Server can publish.