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
<PackageReference Include="Oakrey.Applications.Ohm.Abstractions" Version="2.0.0" />
<PackageVersion Include="Oakrey.Applications.Ohm.Abstractions" Version="2.0.0" />
<PackageReference Include="Oakrey.Applications.Ohm.Abstractions" />
paket add Oakrey.Applications.Ohm.Abstractions --version 2.0.0
#r "nuget: Oakrey.Applications.Ohm.Abstractions, 2.0.0"
#:package Oakrey.Applications.Ohm.Abstractions@2.0.0
#addin nuget:?package=Oakrey.Applications.Ohm.Abstractions&version=2.0.0
#tool nuget:?package=Oakrey.Applications.Ohm.Abstractions&version=2.0.0
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, andIDeviceServicecontracts - 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
DeviceStatuschanges - 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:
- A channel interface derived from
IChannel<TDevice,TReceived,TConfig>. - A client-specific class derived from
ChannelBaseimplementing client creation, connectivity detection, and its receive observable. - A device class derived from
DeviceBaseimplementing channel construction and hardware discovery. - A service derived from
DeviceServiceBaseimplementing 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Oakrey.Applications.Abstractions (>= 7.0.0)
- Oakrey.Applications.Files.Abstractions (>= 7.0.0)
- Oakrey.Applications.Json.Abstractions (>= 7.0.0)
- Oakrey.Applications.UsbNotifying (>= 7.0.1)
- Oakrey.HardwareManager.Client.Common (>= 4.0.1)
- Oakrey.Log.Abstractions (>= 3.0.0)
- Oakrey.ViewModels (>= 3.0.1)
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 |