aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-03 11:02:57 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-03 11:02:57 +1200
commitdb0af8a22724d153baf5a12edc1eb5ee551fbc14 (patch)
tree9c99808cd5b7f1985e4f13bbd54ae4f99299ccdb
parent1f767087fca72d259462d38c5eb2dea47e14c25e (diff)
downloadtraccar-server-db0af8a22724d153baf5a12edc1eb5ee551fbc14.tar.gz
traccar-server-db0af8a22724d153baf5a12edc1eb5ee551fbc14.tar.bz2
traccar-server-db0af8a22724d153baf5a12edc1eb5ee551fbc14.zip
Add new Tytan dynamic code
-rw-r--r--src/org/traccar/protocol/TytanProtocolDecoder.java3
-rw-r--r--test/org/traccar/protocol/TytanProtocolDecoderTest.java4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java
index 72de2068b..56b8f5622 100644
--- a/src/org/traccar/protocol/TytanProtocolDecoder.java
+++ b/src/org/traccar/protocol/TytanProtocolDecoder.java
@@ -160,6 +160,9 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder {
case 83:
buf.readUnsignedInt(); // diagnostic
break;
+ case 90:
+ position.set("power", buf.readFloat());
+ break;
case 99:
buf.readUnsignedInt(); // tachograph
break;
diff --git a/test/org/traccar/protocol/TytanProtocolDecoderTest.java b/test/org/traccar/protocol/TytanProtocolDecoderTest.java
index 1a004c518..b84a217a0 100644
--- a/test/org/traccar/protocol/TytanProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/TytanProtocolDecoderTest.java
@@ -13,8 +13,8 @@ public class TytanProtocolDecoderTest extends ProtocolDecoderTest {
TytanProtocolDecoder decoder = new TytanProtocolDecoder(null);
- /*verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
- "d7700000689d205544713bd3378f2c8e9fe181005affdf9041020000000602a1b7563b0700002055447159d3378f2d8e9fe281005affdf9041020000000602a1b7563b0700002055447177d3378f2e8e9fe181005a861a9141020000000602a1b7563b0700002055447195f3378f2d8e9fe281005a1ce78d41020000000602a1b7563b07000020554471b3d3378f2b8e9fe281005a58d88b41020000000602a1b7563b07000020554471d1f3378f2b8e9fe281005a58d88b41020000000602a1b7563b07000020554471efd3378f2a8e9fe381005a94ac8d41020000000602a1b7563b070000205544720df3378f2c8e9fe281005a1ce78d41020000000602a1b7563b070000205544722bd3378f2d8e9fe281005a48638b41020000000602a1b7563b0700002055447249f3378f308e9fe181005adf128c41020000000602a1b7563b070000"))));*/
+ verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "d7700000689d205544713bd3378f2c8e9fe181005affdf9041020000000602a1b7563b0700002055447159d3378f2d8e9fe281005affdf9041020000000602a1b7563b0700002055447177d3378f2e8e9fe181005a861a9141020000000602a1b7563b0700002055447195f3378f2d8e9fe281005a1ce78d41020000000602a1b7563b07000020554471b3d3378f2b8e9fe281005a58d88b41020000000602a1b7563b07000020554471d1f3378f2b8e9fe281005a58d88b41020000000602a1b7563b07000020554471efd3378f2a8e9fe381005a94ac8d41020000000602a1b7563b070000205544720df3378f2c8e9fe281005a1ce78d41020000000602a1b7563b070000205544722bd3378f2d8e9fe281005a48638b41020000000602a1b7563b0700002055447249f3378f308e9fe181005adf128c41020000000602a1b7563b070000"))));
verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
"D5F0FF00001032552F9121D5325FCB8D11AFA0000205396504004C0602FB5B434118001765006603676B68006B80426C02E2C8206D2F9600"))));