Git Product home page Git Product logo

nt-rs's Introduction

nt-rs

nt-rs is an implementation of the NetworkTables revision 3 protocol in Rust using Tokio. Currently it is purely a client library. An API for creation of an NT server may come in the future.

Getting Started

This library can be found on https://crates.io and can be added to a project with nt = "0.1.0" Sample usages can be found in the examples/ directory

What is NetworkTables?

NetworkTables, or NT, is a TCP based protocol for key-value data storage. It is most used within code for FIRST Robotics Competition robots, for sharing data across the robot's network.

Examples

Connecting to a server

let mut nt = NetworkTables::connect("10.TE.AM.2:1735", "nt-rs-client")?;

Creating a server

let mut nt = NetworkTables::bind("0.0.0.0:1735", "nt-rs-server");

Websockets

nt 1.0.0 adds support for clients and servers communicating over websockets. This is locked behind the websocket feature.

Connecting to a websocket server

let mut nt = NetworkTables::connect_ws("ws://10.TE.AM.2:1735", "nt-ws-client")?;

Creating a websocket server

An existing NetworkTables server is capable of serving websockets if the program is compiled with the websocket feature. In cases where a websocket attempts to connect to a server that has not been configured for websocket clients, it will be sent an error message and the connection will be disconnected.

License

This project is licensed under the MIT license.

Acknowledgements

Thanks to Jess Creighton (https://github.com/jcreigh) for giving me the idea

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.