Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.18 KB

File metadata and controls

40 lines (27 loc) · 1.18 KB

ThingSet.Net

.NET client implementation of the ThingSet protocol. Supported transports are CAN and IP. At present, only the binary wire format (CBOR) is supported.

For more information on ThingSet, see the ThingSet web site.

Installation

NuGet packages are available. Install the client and the separate package for whichever transport you require:

Quick Start

Create a transport and client

IpClientTransport ipTransport = new IpClientTransport("mydevice", 9001);
ThingSetClient client = new ThingSetClient(ipTransport);
await client.ConnectAsync();

Get values and invoke functions

object? value = client.Get(0x100);

object? result = client.Exec(0x300, 1, 2);

Subscribe for reports

await client.SubscribeAsync((uint id, string? path, object? value) =>
{
    Console.WriteLine($"Report: {path} ({id:x}): {value?.ToString()}");
});