VOOZH about

URL: https://www.nuget.org/packages/Oakrey.Guru.Base/

⇱ NuGet Gallery | Oakrey.Guru.Base 4.0.4




👁 Image
Oakrey.Guru.Base 4.0.4

dotnet add package Oakrey.Guru.Base --version 4.0.4
 
 
NuGet\Install-Package Oakrey.Guru.Base -Version 4.0.4
 
 
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.Guru.Base" Version="4.0.4" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.Guru.Base" Version="4.0.4" />
 
Directory.Packages.props
<PackageReference Include="Oakrey.Guru.Base" />
 
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.Guru.Base --version 4.0.4
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Oakrey.Guru.Base, 4.0.4"
 
 
#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.Guru.Base@4.0.4
 
 
#: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.Guru.Base&version=4.0.4
 
Install as a Cake Addin
#tool nuget:?package=Oakrey.Guru.Base&version=4.0.4
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Oakrey.Guru.Base

Base device library for Oakrey Guru USB hardware adapters. Provides the core abstractions and default implementations used by all Guru protocol adapters (CAN, LIN, and others).

Main features

  • IDevice - common contract for Guru adapters: connect, ping, firmware update, bootloader reset
  • ILicense - multi-slot license key retrieval (GetLicenseKey, GetAllLicenseKeys, GetBootLicense)
  • DeviceBase - abstract base class that wires together an ITransceiver and a handler pipeline; extend this to build a concrete adapter
  • FirmwareUpdater - async firmware update from an Intel HEX file; handles bootloader entry, waits for the device to re-enumerate as a mass-storage drive, copies the file, and triggers reboot
  • FirmwareUpdateException - specific exception type for firmware update failures, with a built-in file-existence guard
  • DeviceExtensions.VerifyConnection - runs N ping round-trips, logs average latency, and throws on mismatch
  • HardwareTimeStamp<T> - generic value type that pairs a hardware-reported timestamp with the host DateTime

Architecture

classDiagram
 class IDevice {
 +Connect(ct)
 +Ping(data, ct)
 +GetFwVersion(ct)
 +RestartToBootloader(ct)
 +UpdateFirmware(path, ct)
 +FwUpdateInProgress IObservable~bool~
 }
 class ILicense {
 +GetLicenseKey(id, ct)
 +GetAllLicenseKeys(ct)
 +GetBootLicense(ct)
 }
 class DeviceBase {
 #transceiver ITransceiver
 #commandsManager HandlerCollection
 #deviceLock SemaphoreSlim
 }
 IDevice <|.. DeviceBase
 ILicense <|.. DeviceBase
 DeviceBase <|-- ConcreteAdapter

DeviceBase subscribes to ITransceiver.Received and dispatches each incoming packet to the matching handler via HandlerCollection. Concrete adapters (e.g. CanGuruAdapter, LinGuruAdapter) inherit from DeviceBase, register their own handlers, and expose a protocol-specific API.

Key types

Type Purpose
DeviceBase Abstract base; handles lifecycle, locking, and handler dispatch
FirmwareUpdater Coordinates bootloader entry and HEX file delivery over mass storage
DeviceExtensions Extension methods for connection verification with latency reporting
HardwareTimeStamp<T> Pairs hardware and host timestamps
FirmwareUpdateException Thrown on firmware update failures

Requirements

  • .NET 10 (Windows only � System.Management / WMI is used to detect the bootloader drive)
  • The Guru adapter must support the Guru packet protocol

Installation

.NET CLI

dotnet add package Oakrey.Guru.Base

Package Manager Console

Install-Package Oakrey.Guru.Base

NuGet Package Manager

Search for Oakrey.Guru.Base in Visual Studio under Tools > NuGet Package Manager > Manage NuGet Packages for Solution.

Example usage

Connect and ping

// adapter is a concrete DeviceBase implementation supplied by e.g. Oakrey.Guru.Can
using MyGuruAdapter adapter = new(transceiver);

await adapter.Connect(cancellationToken);

uint echo = await adapter.Ping(0xDEADBEEF, cancellationToken);

Read firmware version and license keys

string version = await adapter.GetFwVersion(cancellationToken);
List<string> keys = await adapter.GetAllLicenseKeys(cancellationToken);

Firmware update

adapter.FwUpdateInProgress.Subscribe(inProgress =>
 Console.WriteLine(inProgress ? "Update started" : "Update finished"));

await adapter.UpdateFirmware(@"C:\firmware\v2.hex", cancellationToken);

The updater:

  1. Sends the bootloader-entry command to the device.
  2. Waits (up to 5 s) for the device to re-enumerate as a removable drive using WMI Win32_VolumeChangeEvent.
  3. Copies the .hex file to that drive.
  4. Writes a reboot trigger file to complete the update.

Development notes

  • All async methods accept a CancellationToken and propagate it through the call chain.
  • deviceLock (a SemaphoreSlim(1,1)) serialises all handler executions; do not bypass it in subclasses.
  • FwUpdateInProgress is a BehaviorSubject-backed IObservable<bool>; subscribe before calling UpdateFirmware to observe the full lifecycle.
  • System.Management is consumed with PrivateAssets="All" so it is not exposed as a transitive dependency to consumers.

Project information

Field Value
Author Oakrey
License MIT
Target framework net10.0-windows
NuGet package Oakrey.Guru.Base
Repository https://dev.azure.com/oakrey/OpenPackages/_git/Drivers

License

MIT. See the LICENSE file for details.

Product Versions Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 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.Guru.Base:

Package Downloads
Oakrey.Guru.Lin

LIN bus adapter library for Oakrey Guru USB hardware. Provides up to 8 independent channels with master/slave role control, baud rate configuration (up to 19200), slave answer table management, bus voltage reading, and reactive Rx streams (ReceivedFrame, StatusChanged, ErrorEvent).

Oakrey.Guru.Can

CAN and CAN-FD adapter library for Oakrey Guru USB hardware. Provides dual-channel bus configuration, per-channel timing and termination, message filtering, inter-channel bridge mode, reactive Rx streams (ReceivedMessage, ReceivedCanEvent, DriverStatusChanged), and simulation support via ISimGuru.

Oakrey.Emu.Can

CAN emulator adapter library for Oakrey Guru Emu USB hardware. Exposes indexed simulation input writing (WriteInputValue) and CRC verification (GetSimCrc) for hardware-in-the-loop testing on top of Oakrey.Guru.Base.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.4 112 5/22/2026
4.0.3 126 5/15/2026
4.0.2 108 5/14/2026
4.0.1 163 2/2/2026
4.0.0 129 1/7/2026
3.0.0 316 11/14/2025
2.1.0 284 6/18/2025
2.0.0 237 6/4/2025
1.0.0 240 4/23/2025