Oakrey.HardwareManager.Client.CANEmulator
5.1.0
dotnet add package Oakrey.HardwareManager.Client.CANEmulator --version 5.1.0
NuGet\Install-Package Oakrey.HardwareManager.Client.CANEmulator -Version 5.1.0
<PackageReference Include="Oakrey.HardwareManager.Client.CANEmulator" Version="5.1.0" />
<PackageVersion Include="Oakrey.HardwareManager.Client.CANEmulator" Version="5.1.0" />
<PackageReference Include="Oakrey.HardwareManager.Client.CANEmulator" />
paket add Oakrey.HardwareManager.Client.CANEmulator --version 5.1.0
#r "nuget: Oakrey.HardwareManager.Client.CANEmulator, 5.1.0"
#:package Oakrey.HardwareManager.Client.CANEmulator@5.1.0
#addin nuget:?package=Oakrey.HardwareManager.Client.CANEmulator&version=5.1.0
#tool nuget:?package=Oakrey.HardwareManager.Client.CANEmulator&version=5.1.0
Oakrey.HardwareManager.Client.CANEmulator
.NET 11 client for controlling CAN Emu devices through Oakrey HardwareManager.
Usage
using Oakrey.HardwareManager.Client.CANEmulator;
CancellationToken cancellationToken = CancellationToken.None;
var devices = await CanEmulatorClientFactory.GetAvailableDevices(cancellationToken);
var deviceId = devices.First().DeviceId!;
using ICanEmulatorClient emulator = await CanEmulatorClientFactory.GetDevice(deviceId, cancellationToken);
await emulator.WriteInputValue(index: 0, value: 123, cancellationToken);
await emulator.UploadEmulation(@"C:\Emulations\simulation.hex", cancellationToken);
Console.WriteLine($"Device: {emulator.Info.DeviceId}, CRC: {emulator.Info.SimCrc}");
WriteInputValue uses the virtual port's portindex and a raw unsigned 16-bit value (0–65535). Apply any profile scale and offset before calling it if your application works with physical values.
UploadEmulation reads a HEX file on the client computer and streams it to the /canemu hub in 16 KiB blocks. The maximum file size is 16 MiB. The server uploads the received file to the connected device and removes its temporary copy on success or failure. A successful operation refreshes Info.SimCrc and device metadata.
Cancellation interrupts transfer or waiting for the result. Once device programming has started, it continues even if the client cancels or disconnects. Keep the device connected until programming finishes.
The channel-free GetDevice(deviceId, cancellationToken) overload selects a CAN Emu device. Existing overloads with a channel parameter remain available for source compatibility. To supply a license explicitly, use GetDevice(deviceId, licenseId, cancellationToken). GetFirstDevice selects the first connected CAN Emu device. HardwareManager still validates the license when connecting.
Device and transfer failures are returned through the awaited tasks. Calls on a disconnected client fail immediately.
Integration checks
From the repository root:
dotnet run --project Tests/CanEmulator.IntegrationTests/CanEmulator.IntegrationTests.csproj
The checks start a local SignalR server on a dynamic loopback port and use a fake emulator. No CAN Emu hardware is required.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Oakrey.HardwareManager.Client.Common (>= 5.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Oakrey.HardwareManager.Client.CANEmulator:
| Package | Downloads |
|---|---|
|
Oakrey.HardwareManager.Plugin.Base
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.