Faactory.Channels.Teltonika
0.1.10
See the version list below for details.
dotnet add package Faactory.Channels.Teltonika --version 0.1.10
NuGet\Install-Package Faactory.Channels.Teltonika -Version 0.1.10
<PackageReference Include="Faactory.Channels.Teltonika" Version="0.1.10" />
paket add Faactory.Channels.Teltonika --version 0.1.10
#r "nuget: Faactory.Channels.Teltonika, 0.1.10"
// Install Faactory.Channels.Teltonika as a Cake Addin #addin nuget:?package=Faactory.Channels.Teltonika&version=0.1.10 // Install Faactory.Channels.Teltonika as a Cake Tool #tool nuget:?package=Faactory.Channels.Teltonika&version=0.1.10
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.
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 );
Beacons
Teltonika supports protocols from iBeacon and Eddystone. The AVL decoder adapter will now automatically decode any beacon elements into it's own structure in the IIOData
type.
The UUId is a 16-byte unique identifier on both iBeacon and Eddystone. However, on the latter, the UUId is a combination of two fields:
- Namespace (10 bytes)
- Instance (6 bytes)
Eddystone does not support major
and minor
fields and uses the above instead.
Tachograph
It is important that firmware version 00.03.79.P1 or higher is used, when using tachograph functionality. Using an older version might result in unwanted behaviour.
The decoders for tachograph are already in place. When decoded, the adapters will forward either a TachoMessage
or a specialized message. Handlers should be implemented accordingly.
So far the following specialized tacho messages are implemented
TachoStatusMessage
TachoErrorMessage
TachoFileBlock
For sending commands, the TachoMessageBuilder
can be used for an easier integration.
Product | Versions 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 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. |
-
net6.0
- Faactory.Channels.Abstractions (>= 0.7.1)
-
net7.0
- Faactory.Channels.Abstractions (>= 0.7.1)
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.4.0 | 112 | 7/2/2024 |
0.4.0-preview-2 | 79 | 6/27/2024 |
0.4.0-preview-1 | 67 | 6/26/2024 |
0.3.0 | 110 | 4/9/2024 |
0.2.0 | 143 | 1/30/2024 |
0.1.12 | 317 | 11/2/2023 |
0.1.11 | 124 | 9/27/2023 |
0.1.10 | 185 | 6/21/2023 |
0.1.9 | 157 | 6/20/2023 |
0.1.8 | 153 | 6/20/2023 |
0.1.7 | 152 | 6/1/2023 |
0.1.6 | 369 | 11/7/2022 |
0.1.5 | 419 | 8/25/2022 |
0.1.4 | 438 | 7/14/2022 |
0.1.3 | 421 | 7/5/2022 |
0.1.2 | 463 | 4/12/2022 |
0.1.1 | 440 | 4/12/2022 |
0.1.0 | 447 | 4/12/2022 |
0.1.0-preview-5 | 159 | 4/11/2022 |
0.1.0-preview-4 | 162 | 4/8/2022 |
0.1.0-preview-3 | 154 | 3/31/2022 |
0.1.0-preview-2 | 159 | 3/31/2022 |
0.1.0-preview-1 | 162 | 3/29/2022 |