Oakrey.ASRockService.Common 2.0.2

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

Oakrey.ASRockService.Common

Project overview

Oakrey.ASRockService.Common is a .NET shared-contracts library for the ASRockService ecosystem. It defines the service interface and data models used by both the ASRockService Windows service and any client that communicates with it over SignalR. The package contains no implementation code � it is a pure contracts assembly intended to be referenced by all layers.

Main features

  • IASRockService � service contract for controlling an ASRock motherboard:
    • Release the device
    • Set PSU output state (on / off)
    • Set the general output pin state
    • Set a specific GPIO pin to output mode with a given state
    • Set a specific GPIO pin to input mode
  • DeviceInfo � describes device-level configuration, including the autoload flag and a list of PinInfo entries
  • PinInfo � describes a single GPIO pin: pin number, name, direction (input / output), and current state

Architecture

The package is one component of a three-part solution:

graph TD
    A[ASRockService.Common<br>Contracts NuGet] --> B[ASRockService.Service<br>ASP.NET Core Windows Service<br>SignalR hub on port 4753]
    A --> C[ASRockService.Tray<br>Windows Forms tray application<br>SignalR client]
    B -- SignalR --> C
Component Type Role
ASRockService.Common .NET library (NuGet) Shared contracts � IASRockService, DeviceInfo, PinInfo
ASRockService.Service ASP.NET Core Windows service (net10.0-windows) Hosts the SignalR DeviceHub, drives the ASRock HAL, listens on http://*:4753
ASRockService.Tray Windows Forms library (net10.0-windows) System-tray UI and management client

Requirements

  • .NET 10
  • The package itself has no platform restriction; the service and tray components require Windows

Installation

.NET CLI

dotnet add package Oakrey.ASRockService.Common

Package Manager Console

Install-Package Oakrey.ASRockService.Common

NuGet Package Manager

Search for Oakrey.ASRockService.Common in Tools > NuGet Package Manager > Manage NuGet Packages for Solution.

Example usage

Implement IASRockService in a SignalR client to receive strongly-typed calls from the server:

using Oakrey.ASRockService.Common;
using Microsoft.AspNetCore.SignalR.Client;

HubConnection connection = new HubConnectionBuilder()
    .WithUrl("http://localhost:4753/deviceHub")
    .Build();

// Register a handler for a GPIO state notification pushed by the server
connection.On<int, bool>(nameof(IASRockService.SetGpioOutState), (pin, state) =>
{
    Console.WriteLine($"Pin {pin} changed to {state}");
});

await connection.StartAsync();

// Invoke a method on the server
await connection.InvokeAsync(nameof(IASRockService.SetPsu), true, CancellationToken.None);

Use DeviceInfo and PinInfo to deserialize device configuration:

DeviceInfo config = new DeviceInfo(autoload: true)
{
    PinConfigs =
    [
        new PinInfo(state: false, isInput: true,  name: "GPIO71", pinNumber: 71),
        new PinInfo(state: true,  isInput: false, name: "GPIO72", pinNumber: 72),
    ]
};

Development notes

  • Configuration is persisted as JSON in %ProgramData%\ASRockDriver\config.asrconf.
  • The service registers itself as a Windows Service via UseWindowsService() and logs to the Windows Event Log.
  • The hardware abstraction layer is provided by the Oakrey.ASRockMotherboard package (not part of this contracts library).
  • The hardcoded device name in the service is ASRock Motherboard IMB-1222-WV.

License

MIT � Copyright (c) Oakrey 2016-present

This project is licensed under the MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Oakrey.ASRockService.Common:

Package Downloads
Oakrey.ASRockService.Client

SignalR client library for ASRockService. Use AsRockFactory to connect to the ASRockService Windows service (port 4753, MessagePack protocol) and control ASRock motherboard GPIO pins, PSU, and output states. Exposes IASRockClient with read (HTTP) and write (SignalR hub) operations. Supports COM interop.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 183 5/14/2026
2.0.1 146 2/2/2026
2.0.0 271 7/8/2025
1.0.0 272 5/28/2025