NetworkTablesSharp 1.0.2

dotnet add package NetworkTablesSharp --version 1.0.2
                    
NuGet\Install-Package NetworkTablesSharp -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetworkTablesSharp" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetworkTablesSharp" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="NetworkTablesSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetworkTablesSharp --version 1.0.2
                    
#r "nuget: NetworkTablesSharp, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NetworkTablesSharp@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NetworkTablesSharp&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=NetworkTablesSharp&version=1.0.2
                    
Install as a Cake Tool

NetworkTablesSharp

A bare-bones implementation of NT4 (4.0) for C#. Designed for unity but does not rely on it.

If you are looking to use this package for unity, consider following this guide so that log messages appear in the console.

Disclaimer: This package has not been thourogly tested, and may have issues. This package may or may not be updated and supported in the future.

Installation

Note: Unity users will need to install NuGetForUnity

Install this NuGet Package: NetworkTablesSharp

Usage

For convinience and usability, Nt4Source is provided. It provides a user-friendly wrapper around the client with convinience features such as queing subscriptions/topic publishes to ensure things work even after a reconnect. It also stores all previous values.

Connecting

// Default values shown here
Nt4Source Source = new Nt4Source(string serverAddress = "127.0.0.1", string appName = "Nt4Unity", bool connectAutomatically = true, int port = 5810);

// Not needed if you leave connectAutomatically as true
Source.Connect();
Source.Disconnect();

Subscribing and retrieving data

Source.Subscribe("Key");

string latestValue = Source.GetValue<string>("Key");
string specificValue = Source.GetValue<string>("Key", Source.GetServerTimeUs());

Publishing data

Note: Publishing data has not been properly tested.

Source.PublishTopic("key", "type" /* ex. string, int */);
Source.PublishValue("key", "value")

If you prefer, you can also use the Nt4Client class directly. The API Is documented, look at the file to see how to use it.

Credits

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 153 12/13/2024
1.0.1 116 12/13/2024
1.0.0 109 12/13/2024