Lawo / ember-plus-sharp

Quickly implement fully type-safe Ember+ consumers in any .NET language
http://lawo.github.io/ember-plus-sharp
Boost Software License 1.0
21 stars 12 forks source link

EmBER+ Sharp Project

Check out the documentation for the EmBER+. This is the C#, .net library for a EmBER+ Consumer.

Soluton contains:

Example to get started

// Note that the most-derived subtype MyRoot needs to be passed to the generic base class.
// Represents the root containing dynamic and optional static elements in the object tree accessible through Consumer<TRoot>.Root
private class MyRoot : DynamicRoot<MyRoot> { }

// Create TCP connection
var tcpClient = new TcpClient();
await tcpClient.ConnectAsync("localhost", "9001");

// Establish S101 protocol
// S101 provides message packaging, CRC integrity checks and a keep-alive mechanism.
var stream = tcpClient.GetStream();
var s101Client = new S101Client(tcpClient, stream.ReadAsync, stream.WriteAsync);

// Create consumer
var consumer = await Consumer<MyRoot>.CreateAsync(s101Client));

// Navigate down tree until IParameter is reached or desired INode
var mixer = (INode)root.Children.First(c => c.Identifier == "MixerEmberIdentifier");
var mute = (IParameter)mixer.Children.First(c => c.Identifier == "Mute");

mute.Value = true;