![]() |
VOOZH | about |
dotnet add package Oakrey.Guru.Base --version 4.0.4
NuGet\Install-Package Oakrey.Guru.Base -Version 4.0.4
<PackageReference Include="Oakrey.Guru.Base" Version="4.0.4" />
<PackageVersion Include="Oakrey.Guru.Base" Version="4.0.4" />Directory.Packages.props
<PackageReference Include="Oakrey.Guru.Base" />Project file
paket add Oakrey.Guru.Base --version 4.0.4
#r "nuget: Oakrey.Guru.Base, 4.0.4"
#:package Oakrey.Guru.Base@4.0.4
#addin nuget:?package=Oakrey.Guru.Base&version=4.0.4Install as a Cake Addin
#tool nuget:?package=Oakrey.Guru.Base&version=4.0.4Install as a Cake Tool
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).
IDevice - common contract for Guru adapters: connect, ping, firmware update, bootloader resetILicense - 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 adapterFirmwareUpdater - 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 rebootFirmwareUpdateException - specific exception type for firmware update failures, with a built-in file-existence guardDeviceExtensions.VerifyConnection - runs N ping round-trips, logs average latency, and throws on mismatchHardwareTimeStamp<T> - generic value type that pairs a hardware-reported timestamp with the host DateTimeclassDiagram
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.
| 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 |
System.Management / WMI is used to detect the bootloader drive).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.
// 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);
string version = await adapter.GetFwVersion(cancellationToken);
List<string> keys = await adapter.GetAllLicenseKeys(cancellationToken);
adapter.FwUpdateInProgress.Subscribe(inProgress =>
Console.WriteLine(inProgress ? "Update started" : "Update finished"));
await adapter.UpdateFirmware(@"C:\firmware\v2.hex", cancellationToken);
The updater:
Win32_VolumeChangeEvent..hex file to that drive.reboot trigger file to complete the update.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.| 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 |
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. |
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. |
This package is not used by any popular GitHub repositories.