Oakrey.Capsule.Base 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Oakrey.Capsule.Base --version 2.0.0
                    
NuGet\Install-Package Oakrey.Capsule.Base -Version 2.0.0
                    
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.Capsule.Base" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.Capsule.Base" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Oakrey.Capsule.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.Capsule.Base --version 2.0.0
                    
#r "nuget: Oakrey.Capsule.Base, 2.0.0"
                    
#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.Capsule.Base@2.0.0
                    
#: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.Capsule.Base&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.Capsule.Base&version=2.0.0
                    
Install as a Cake Tool

Oakrey.Capsule.Base

Overview

The Capsule library is a .NET 8-based framework designed for efficient serialization, deserialization, and management of protocol-based data capsules. It provides a robust and extensible structure for handling binary data, enabling seamless communication between systems. The library is ideal for developers working on communication protocols, logging systems, and data serialization tasks.

Features

Capsule Management:

  • Abstract base class (CapsuleBase) for creating custom capsules.
  • Interface (ICapsule) for defining capsule behavior.
  • Caching mechanism for efficient capsule reuse.

Serialization and Deserialization:

  • Serialize capsules into binary format for transmission.
  • Deserialize binary payloads into capsule objects.
  • Helper methods for working with binary data (BinaryWriterHelper, SpanHelper).

Capsule Header:

  • CapsuleHead class for managing metadata such as hardware ID, protocol ID, timestamp, and version.

Logging Support:

  • LoggingCapsule for encapsulating log messages with associated log codes.
  • Enum (LogCode) for defining standardized log codes.

Utilities:

  • SpanHelper for extracting data from byte spans.
  • UTF-8 string writing support via BinaryWriterHelper.

Installation

You can install the package via NuGet Package Manager, Package Manager Console or the .NET CLI.

NuGet Package Manager

  1. Open your project in Visual Studio.
  2. Navigate to Tools > NuGet Package Manager > Manage NuGet Packages for Solution....
  3. Search for Oakrey.Capsule.Base and click Install.

.NET CLI

Run the following command in your terminal:

dotnet add package Oakrey.Capsule.Base

Package Manager Console

Run the following command in your Package Manager Console:

Install-Package Oakrey.Capsule.Base

Requirements

  • .NET 8 or higher

Project Information

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve the package.

License

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 (3)

Showing the top 3 NuGet packages that depend on Oakrey.Capsule.Base:

Package Downloads
Oakrey.Capsule.Lin

Capsule.Lin provides LIN bus message types, multi-message batching, channel settings, and channel status capsules encoded in the Oakrey Capsule binary framing protocol. Supports Observer, Slave, Master, and Scheduler channel modes. Suitable for automotive and industrial data-logging scenarios.

Oakrey.Capsule.Metadata

Capsule.Metadata encodes strongly-typed key-value metadata records into the Oakrey Capsule binary framing protocol (capsule ID 0xFFFF). Each record carries a key, a DataType (String, Boolean, Byte, Short, Long, Int, Float, Double), an optional Unit, and a typed value. Up to 255 records can be batched in a single MetaCapsule. Suitable for IoT, telemetry, and data-logging scenarios.

Oakrey.Capsule.Can

Capsule.Can provides CAN and CAN-FD message types, multi-message batching, channel settings, and channel status capsules encoded in the Oakrey Capsule binary framing protocol. Suitable for automotive, industrial, and IoT data-logging and communication scenarios.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 216 5/22/2026
2.0.1 159 5/15/2026
2.0.0 188 2/2/2026
1.0.0 345 4/22/2025