Oakrey.Applications.Ohm.Abstractions 2.0.0

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

Oakrey.Applications.Ohm

Shared contracts, configuration models, collections, and lifecycle base classes for Oakrey hardware-bus integrations.

The package contains the protocol-independent foundation used by Oakrey.Applications.Ohm.CAN and Oakrey.Applications.Ohm.LIN. It can also be used to implement another channel-based transport without duplicating synchronization, reactive-stream, configuration, discovery, or disposal logic.

Features

  • Common IChannel, IDevice, and IDeviceService contracts
  • Strongly typed generic variants for messages, configurations, clients, devices, and channel collections
  • Thread-safe channel connection and disconnection
  • Synchronized reactive streams for received messages and DeviceStatus changes
  • Deterministic, idempotent cleanup of clients, subscriptions, devices, and services
  • Device discovery serialized through a refresh gate
  • Debounced and cancellable USB hot-plug refresh
  • JSON configuration loading, saving, validation, and clean-start support
  • Reusable channel collections and serializable configuration base types

Installation

dotnet add package Oakrey.Applications.Ohm

The library targets .NET 10 for Windows.

Architecture

IChannel                         IDevice                         IDeviceService
   │                                │                                  │
   ├─ IChannel<T...>                ├─ IDevice<TChannel>               └─ IDeviceService<T...>
   │                                ├─ IReceivingDevice<T...>                    │
   └─ ChannelBase<T...>             ├─ IDevice<T...>                            └─ DeviceServiceBase<T...>
                                    └─ DeviceBase<T...>

Protocol packages derive their concrete implementations from the three base classes:

ChannelBase     ──► CanChannel / LinChannel
DeviceBase      ──► CanDevice / LinDevice
DeviceServiceBase ─► CanDeviceService / LinDeviceService

Main types

Type Purpose
IChannel Protocol-independent channel state and lifecycle contract
IChannel<TDevice,TReceived,TConfig> Typed parent, receive stream, and configuration contract
ChannelBase<TDevice,TReceived,TConfig,TClient> Owns the client, connection gate, Rx subjects, and channel disposal
IDevice Common physical-device identity and status contract
IDevice<T...> Typed channels, receive stream, configuration, and hardware type
DeviceBase<T...> Owns channels, channel subscriptions, refresh synchronization, and disposal
IDeviceService Common discovery, connection, persistence, and trace-selection API
DeviceServiceBase<T...> Owns devices, USB refresh, persistence, aggregate streams, and service disposal
ChannelCollection<TChannel> Observable collection with connection and trace helpers
ChannelConfig<TChannel> Serializable channel configuration base
DeviceConfig<TConfig,TChannel> Serializable device configuration base
DeviceStatus Unknown, Connected, Disconnected, or Error

Lifecycle guarantees

ChannelBase serializes Connect and Disconnect. Repeated connection attempts do not replace an active client, failed or cancelled attempts clean up temporary clients, and receive-stream failures publish DeviceStatus.Error.

DeviceBase aggregates channel messages and statuses. Channel refresh and disposal cannot run concurrently, and old subscriptions and channels are disposed before a refreshed collection becomes active.

DeviceServiceBase serializes discovery, removes unavailable devices safely, owns per-device subscriptions, and coalesces bursts of USB notifications into one delayed refresh. Public operations validate their inputs and reject use after disposal.

All base classes implement deterministic disposal. Register device services with a DI lifetime that disposes them during application shutdown, normally singleton.

Implementing another protocol

A protocol adapter normally supplies:

  1. A channel interface derived from IChannel<TDevice,TReceived,TConfig>.
  2. A client-specific class derived from ChannelBase implementing client creation, connectivity detection, and its receive observable.
  3. A device class derived from DeviceBase implementing channel construction and hardware discovery.
  4. A service derived from DeviceServiceBase implementing device construction, connection, disconnection, and configuration mapping.

Keep transport-specific send operations on the protocol channel interface; the common channel contract intentionally models only behavior shared by all transports.

Configuration

ChannelConfig and DeviceConfig expose parameterless construction for System.Text.Json. Derived configuration types should retain a public parameterless constructor and may add a constructor that captures a live channel or device.

The service stores its configuration beside IApplicationInfo.UserSettingsPath. The concrete protocol selects the filename.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
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 Oakrey.Applications.Ohm.Abstractions:

Package Downloads
Oakrey.Applications.Ohm.CAN

Service layer library for managing CAN bus hardware devices and channels. Provides device discovery, connection lifecycle management, reactive IObservable streams for received frames and status changes, per-channel transmit, USB hot-plug detection, and persistent JSON configuration.

Oakrey.Applications.Ohm.LIN

Service layer library for managing LIN bus hardware devices and channels. Provides discovery, robust connection lifecycle management, reactive received-frame and status streams, USB hot-plug detection, and persistent JSON configuration.

Oakrey.Applications.Dashboards.Abstractions

Shared generic dashboard models, services, collections, and WPF view-model infrastructure for Oakrey CAN and LIN applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 60 9/4/2026