aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-06-05 23:33:48 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-06-05 23:33:48 -0700
commit473e671a14bb826cdbf73f732fbd8b8eec6f3986 (patch)
treeb118a148c3ac96d2f243a7bc8165d96fb1031266 /src/main/java
parent8acd5f768df28622506a292b6efec0198f27967d (diff)
downloadtrackermap-server-473e671a14bb826cdbf73f732fbd8b8eec6f3986.tar.gz
trackermap-server-473e671a14bb826cdbf73f732fbd8b8eec6f3986.tar.bz2
trackermap-server-473e671a14bb826cdbf73f732fbd8b8eec6f3986.zip
Support Teltonika codec 13
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
index ab7aa4b43..be7a01ee0 100644
--- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -78,6 +78,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
public static final int CODEC_8 = 0x08;
public static final int CODEC_8_EXT = 0x8E;
public static final int CODEC_12 = 0x0C;
+ public static final int CODEC_13 = 0x0D;
public static final int CODEC_16 = 0x10;
private void sendImageRequest(Channel channel, SocketAddress remoteAddress, long id, int offset, int size) {
@@ -598,7 +599,13 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(deviceSession.getDeviceId());
position.setValid(true);
- if (codec == CODEC_12) {
+ if (codec == CODEC_13) {
+ buf.readUnsignedByte(); // type
+ int length = buf.readInt() - 4;
+ getLastLocation(position, new Date(buf.readUnsignedInt() * 1000));
+ position.set(Position.KEY_RESULT,
+ buf.readCharSequence(length, StandardCharsets.US_ASCII).toString().trim());
+ } else if (codec == CODEC_12) {
decodeSerial(channel, remoteAddress, position, buf);
} else {
decodeLocation(position, buf, codec);