![]() |
VOOZH | about |
dotnet add package CanKit.Core --version 0.5.5
NuGet\Install-Package CanKit.Core -Version 0.5.5
<PackageReference Include="CanKit.Core" Version="0.5.5" />
<PackageVersion Include="CanKit.Core" Version="0.5.5" />Directory.Packages.props
<PackageReference Include="CanKit.Core" />Project file
paket add CanKit.Core --version 0.5.5
#r "nuget: CanKit.Core, 0.5.5"
#:package CanKit.Core@0.5.5
#addin nuget:?package=CanKit.Core&version=0.5.5Install as a Cake Addin
#tool nuget:?package=CanKit.Core&version=0.5.5Install as a Cake Tool
Core abstractions and utilities for CanKit: unified CAN bus API, endpoints, frames, filters, timing, and helpers.
CanKit.CoreThis package defines the common interfaces and helpers. To talk to real hardware, install an adapter package such as:
CanKit.Adapter.SocketCAN (Linux)CanKit.Adapter.PCAN (PEAK PCAN-Basic)CanKit.Adapter.Kvaser (Kvaser CANlib)CanKit.Adapter.ZLG (ZLGCAN)CanKit.Adapter.Virtual (no hardware, for testing)简体中文
dotnet add package CanKit.Core
Below uses the Virtual adapter for a minimal example. Replace the endpoint with your adapter’s scheme (e.g., socketcan://can0, pcan://PCAN_USBBUS1).
using CanKit.Core;
using CanKit.Core.Definitions;
// Open a bus by endpoint; configure bitrate at open
using var bus = CanBus.Open("virtual://demo/0", cfg => cfg.Baud(500_000));
// Transmit a classic CAN frame
var tx = CanFrame.Classic(0x123, new byte[] { 1, 2, 3 });
bus.Transmit(new[] { tx });
// Receive with timeout (ms)
foreach (var rx in bus.Receive(1, 100))
{
var f = rx.CanFrame;
Console.WriteLine($"RX id=0x{f.ID:X}, dlc={f.Dlc}");
}
For CAN FD, configure both arbitration/data bitrates:
using var fdBus = CanBus.Open("virtual://demo/1", cfg => cfg.Fd(500_000, 2_000_000));
List endpoints exposed by installed adapters:
using CanKit.Core.Endpoints;
foreach (var ep in BusEndpointEntry.Enumerate())
{
Console.WriteLine($"{ep.Title}: {ep.Endpoint}");
}
Filter by scheme/vendor:
foreach (var ep in BusEndpointEntry.Enumerate("socketcan", "pcan", "kvaser", "zlg", "virtual"))
{
Console.WriteLine(ep.Endpoint);
}
cfg.Baud(...) for Classical CAN, cfg.Fd(abit, dbit, ...) for CAN FD.CanReceiveData.CanFrame. Build frames with CanClassicFrame or other implementations.| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net8.0-windows7.0 net8.0-windows7.0 is compatible. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on CanKit.Core:
| Package | Downloads |
|---|---|
|
CanKit.Adapter.ZLG
ZLG adapter for CanKit, enabling unified access to ZLG USBCAN/PCIe CAN/CAN FD devices (zlgcan.dll). |
|
|
CanKit.Adapter.PCAN
Peak PCAN (PCAN-Basic) adapter for CanKit, providing unified bus access to PCAN hardware on Windows. |
|
|
CanKit.Adapter.Kvaser
Kvaser CANlib adapter for CanKit, enabling unified CAN/CAN FD access to Kvaser devices. |
|
|
CanKit.Adapter.Virtual
Virtual in-process CAN adapter for CanKit for development, testing, and simulation. |
|
|
CanKit.Adapter.SocketCAN
SocketCAN adapter for CanKit, offering unified CAN/CAN FD access on Linux via kernel CAN. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 0.5.5 | 512 | 3/22/2026 | |
| 0.5.4 | 583 | 12/14/2025 | |
| 0.5.3 | 679 | 12/8/2025 | |
| 0.5.2 | 1,017 | 12/2/2025 | |
| 0.5.1 | 626 | 11/10/2025 | |
| 0.5.0 | 470 | 11/1/2025 | |
| 0.4.0 | 551 | 10/27/2025 | |
| 0.3.3.1 | 448 | 10/23/2025 | |
| 0.3.3 | 416 | 10/23/2025 | |
| 0.3.2 | 429 | 10/21/2025 | |
| 0.3.1 | 382 | 10/18/2025 | |
| 0.2.1 | 429 | 10/13/2025 | 0.2.1 is deprecated because it has critical bugs. |
| 0.2.0 | 475 | 10/12/2025 | 0.2.0 is deprecated because it has critical bugs. |
## 0.5.5
### Added
* `FrameObserved` event as the preferred replacement for `FrameReceived`, to make the `CanFrame` lifecycle clearer.
### Changed
* Improved cancellation handling in CAN bus poll loops.
* `FrameReceived` is now marked as `Obsolete` in favor of `FrameObserved`, but remains available for backward compatibility.
### Fixed
* None.
### Performance
* None.
### Breaking Changes
* None.