Faactory.Channels.Teltonika 0.1.5

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

// Install Faactory.Channels.Teltonika as a Cake Tool
#tool nuget:?package=Faactory.Channels.Teltonika&version=0.1.5

Channels - Teltonika Protocol

This project contains a set of Channels adapters to decode data encoded with Teltonika's protocol. The supported codecs for device data include

  • Codec 8
  • Codec 8 Extended
  • Codec 16

The following codecs for communication are also supported

  • Codec 12
  • Codec 13
  • Codec 14

NOTE: This library is still experimental and should not be used in production.

Learn more about Channels.

dotnet workflow

Getting started

Install the package from NuGet

dotnet add package Faactory.Channels.Teltonika

To enable decoding of Teltonika packets on the input pipeline, we just need to register the respective adapters with the channel pipeline. We do that with an extension method.

IChannelBuilder builder = ...;

builder.AddTeltonikaDecoderAdapters();

With the adapters in place, we need to implement our handlers to handle the correct data. The different kinds of data are

  • Identity Data
  • AVL Data
  • Message Data

Identity Data

This is the first thing that a device sends and it contains the identifier for the device, typically its IMEI. The ModuleId is a struct with an implicit string operator.

Example of an identity handler

public class MyIdentityHandler : ChannelHandler<ModuleId>
{
    public override Task ExecuteAsync( IChannelContext context, ModuleId data )
    {
        // do whatever we need to do with the identifier
        bool isAllowed = someService.IsDeviceAllowed( data );

        // if we don't want to allow the device to communicate, we can close the channel
        if ( !isAllowed )
        {
            return context.Channel.CloseAsync();
        }

        return Task.CompletedTask;
    }
}

AVL Data

Contains telemetry data sent by the device. Since the base handler takes care of T <--> T[] mutation, we can choose to implement our handler with IAvlData[] or IAvlData.

Example of an AVL handler

public class MyDataHandler : ChannelHandler<IAvlData[]>
{
    public override Task ExecuteAsync( IChannelContext context, IAvlData[] data )
    {
        // do whatever we need to do
        return Task.CompletedTask;
    }
}

Message Data

Used for device-server communication, configuration, digital outputs control commands or other special purpose commands. Since the base handler takes care of T <--> T[] mutation, we can choose to implement our handler with IMessageData[] or IMessageData.

Example of a Message handler

public class MyMessageHandler : ChannelHandler<IMessageData[]>
{
    public override Task ExecuteAsync( IChannelContext context, IMessageData[] data )
    {
        // do whatever we need to do
        return Task.CompletedTask;
    }
}

This type of data can also be used for server-device communication. To enable this, we need to add the encoder adapter to the output pipeline as well.

IChannelBuilder builder = ...;

builder.AddOutputAdapter<MessageEncoderAdapter>();

We can then use the MessageBuilder to create custom messages and push it into the output pipeline. For example

// create a Codec 12 message
var codec12Message = MessageBuilder.Create( 0x05, customPayload );

// create a Codec 13 message
var codec13Message = MessageBuilder.Create( customPayload, DateTime.UtcNow );
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.

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.3.0 102 4/9/2024
0.2.0 114 1/30/2024
0.1.12 302 11/2/2023
0.1.11 119 9/27/2023
0.1.10 179 6/21/2023
0.1.9 151 6/20/2023
0.1.8 146 6/20/2023
0.1.7 146 6/1/2023
0.1.6 358 11/7/2022
0.1.5 414 8/25/2022
0.1.4 432 7/14/2022
0.1.3 415 7/5/2022
0.1.2 458 4/12/2022
0.1.1 435 4/12/2022
0.1.0 440 4/12/2022
0.1.0-preview-5 156 4/11/2022
0.1.0-preview-4 158 4/8/2022
0.1.0-preview-3 148 3/31/2022
0.1.0-preview-2 153 3/31/2022
0.1.0-preview-1 157 3/29/2022