LibCodec8 0.9.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package LibCodec8 --version 0.9.2                
NuGet\Install-Package LibCodec8 -Version 0.9.2                
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="LibCodec8" Version="0.9.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LibCodec8 --version 0.9.2                
#r "nuget: LibCodec8, 0.9.2"                
#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.
// Install LibCodec8 as a Cake Addin
#addin nuget:?package=LibCodec8&version=0.9.2

// Install LibCodec8 as a Cake Tool
#tool nuget:?package=LibCodec8&version=0.9.2                

About

Decoder for Codec 8 and Codec 8 Extended (currently only TCP, no UDP support) formats that are used by certain Teltonika devices.

How to use

To decode Codec8

using Codec8;

string input = "000000000000003608010000016B40D8EA30010000000000000000000000000000000105021503010101425E0F01F10000601A014E0000000000000000010000C7CF";
(GenericDecodeResult result, object valueOrError) = Codec8Decoder.ParseHexadecimalString(input);
if (result == GenericDecodeResult.SuccessCodec8)
{
    Codec8Frame frame = (Codec8Frame)valueOrError;
}

To decode Codec8 Extended

using Codec8;

string input = "000000000000004A8E010000016B412CEE000100000000000000000000000000000000010005000100010100010011001D00010010015E2C880002000B000000003544C87A000E000000001DD7E06A00000100002994";
(GenericDecodeResult result, object valueOrError) = Codec8ExtendedDecoder.ParseHexadecimalString(input);
if (result == GenericDecodeResult.SuccessCodec8Extended)
{
    Codec8ExtendedFrame frame = (Codec8ExtendedFrame)valueOrError;
}

If you don't know what kind of data you have, you can use generic decoder

using Codec8;

string input = "000000000000004A8E010000016B412CEE000100000000000000000000000000000000010005000100010100010011001D00010010015E2C880002000B000000003544C87A000E000000001DD7E06A00000100002994";
(GenericDecodeResult result, object valueOrError) = GenericDecoder.ParseHexadecimalString(input);
if (result == GenericDecodeResult.SuccessCodec8)
{
    Codec8Frame frame = (Codec8Frame)valueOrError;
}
else if (result == GenericDecodeResult.SuccessCodec8Extended)
{
    Codec8ExtendedFrame frame = (Codec8ExtendedFrame)valueOrError;
}
else
{
    Console.Writeline($"Expected success, but got: {valueOrError}");
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.9.3 298 11/22/2023
0.9.2 352 4/30/2023
0.9.1 232 4/10/2023
0.9.0 181 4/3/2023