Essy.EssyBus 2.3.5

dotnet add package Essy.EssyBus --version 2.3.5
                    
NuGet\Install-Package Essy.EssyBus -Version 2.3.5
                    
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="Essy.EssyBus" Version="2.3.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Essy.EssyBus" Version="2.3.5" />
                    
Directory.Packages.props
<PackageReference Include="Essy.EssyBus" />
                    
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 Essy.EssyBus --version 2.3.5
                    
#r "nuget: Essy.EssyBus, 2.3.5"
                    
#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 Essy.EssyBus@2.3.5
                    
#: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=Essy.EssyBus&version=2.3.5
                    
Install as a Cake Addin
#tool nuget:?package=Essy.EssyBus&version=2.3.5
                    
Install as a Cake Tool

EssyBus .NET Library

EssyBus is a lightweight and robust communication library for interacting with devices over the EssyBus protocol.
It provides a clean abstraction between the underlying physical transport (UART, RS-485, USB, etc.) and your high-level device logic.

This package includes:

  • EssyBus — Manages communication, framing, retries, and device orchestration.
  • EssyBusClient — Base class for building device-specific drivers.
  • IPhysicalLayer — Interface you implement to link EssyBus to your hardware or simulation layer.
  • A structured exception hierarchy.

✨ Features

🔌 Pluggable Physical Layer

Implement IPhysicalLayer to make EssyBus work with:

  • Serial ports
  • USB bridges
  • RS-485 interfaces
  • Hardware simulators
  • Unit-test stubs

🧱 High-Level Client Framework

Derive your device classes from EssyBusClient to automatically get:

  • Typed request/response handling
  • EncodeFunction / EncodeMethod helpers
  • Async and sync APIs
  • Built-in Ping & FirmwareVersion access
  • Automatic casting to numeric, float, string types

🔁 Robust Error Handling

EssyBus includes:

  • Automatic retry logic
  • Bus reset on communication failures
  • Checksum verification
  • Timeout/error propagation
  • Fatal-error protection

⚡ Interrupt Handling Support

Devices can signal interrupts using the physical layer interrupt line.
Implement:

  • IEssyBusClientInterrupt
  • IEssyBusClientResetable

EssyBus will automatically dispatch interrupts when detected.

🔧 Automatic Device Reset

If enabled, devices implementing IEssyBusClientResetable are automatically reset when added.


📦 Installation

dotnet add package EssyBus

🚀 Getting Started

1. Implement the Physical Layer

public class SerialPhysicalLayer : IPhysicalLayer
{
    // Implement WriteBytes, ReadBytes, interrupts, etc.
}

2. Create and Configure EssyBus

var bus = new EssyBus(new SerialPhysicalLayer());

3. Build Your Device Client

public class MyDevice : EssyBusClient
{
    public MyDevice(byte address) : base(address, "My Device") {}

    public int GetTemperature()
    {
        EncodeFunction(10, out int temp);
        return temp;
    }
}

4. Add Client and Communicate

var device = new MyDevice(1);
bus.AddClient(device);

Console.WriteLine(device.GetTemperature());

🧩 Architecture Overview

EssyBus

Handles communication, framing, retries, checksum, STX/ETX formatting, interrupt dispatch, and optional async operations.

EssyBusClient

Provides strongly typed access to device methods:

  • EncodeFunction(...)
  • EncodeMethod(...)
  • Async equivalents
  • Auto firmware retrieval
  • Ping(), RebootDevice(), DisconnectedFromBus()

Exception Types

  • EssyBusException
  • PhysicalLayerException
  • EssyBusClientException
  • FatalEssyBusException

🛠 Protocol Details

EssyBus currently supports two protocol versions, selected transparently per device.

Protocol V1 (Legacy)

STX (255) | Address | Leader | Length | HEX(Data...) | Checksum | ETX (254) | EOT (253)
  • Payload bytes are HEX-encoded (each byte → two nibbles)
  • Maximum payload: 250 bytes
  • Checksum = sum(payload) mod 250
  • Simple framing, no escaping
  • Used by default for legacy devices

Protocol V2 (Enhanced)

Protocol V2 removes HEX encoding and introduces binary framing with escaping and extended length support.

STX_V2 (251)
Address | Leader | Length (low, high) | Data (escaped) | Checksum | ETX (254) | EOT (253)
Key Improvements
  • Binary payload (no HEX expansion)
  • Escaping using ESC = 250 for any byte > 250
  • 16-bit payload length (low + high byte)
  • Higher throughput and lower latency
  • Fully backward compatible at the bus level
Escaping Rules

Any byte with value > 250 is encoded as:

ESC, (byte - 250)

This applies to:

  • Payload bytes
  • Length bytes

Checksum is calculated on the unescaped payload:

checksum = sum(payload) % 250

Selecting Protocol Version

Protocol selection is per client:

public class MyDevice : EssyBusV2Client
{
    public MyDevice(byte address) : base(address, "My V2 Device") {}
}
  • EssyBusClient → Protocol V1
  • EssyBusV2Client → Protocol V2

The EssyBus automatically handles framing, retries, and decoding based on the client type.


📄 License

MIT License


🧯 Logging / Debugging

var loggerFactory = LoggerFactory.Create(b => b.AddConsole());
var bus = new EssyBus(myPhysicalLayer, loggerFactory);
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 is compatible.  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 is compatible.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on Essy.EssyBus:

Package Downloads
Essy.EssyBus.FTDI

An FTDI implementation of the EssyBus

EssyBusBLDCMotorController

An IMotor implementation for a BLDC motor attached to the EssyBus

EssyBusStepperMotorController

An IMotor implementation for a Stepper motor attached to the EssyBus

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.3.5 336 12/16/2025
2.3.4 269 12/16/2025
2.3.3 132 12/12/2025
2.3.2 130 12/12/2025
2.3.1 121 12/12/2025
2.3.0 422 12/11/2025
2.2.0 147 12/6/2025
2.1.2 680 12/3/2025
2.1.1 679 12/3/2025
2.1.0 681 12/3/2025
2.0.0 683 12/2/2025
1.6.0 198 11/26/2025
1.5.2 326 11/17/2025
1.5.1 288 11/16/2025
1.3.0.10 468 7/28/2025

Fixed issue with returning data that is escaped