aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-12-01 01:07:03 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-12-01 01:07:03 +1300
commit56e496c728faede7a6b26a382e87081dec569f78 (patch)
tree6fdf4828dfbd957fe7446bc6ca0224d36c6098af
parent8e567d133c3d342cebd505c6d2effe6b2a41cb7b (diff)
downloadtrackermap-server-56e496c728faede7a6b26a382e87081dec569f78.tar.gz
trackermap-server-56e496c728faede7a6b26a382e87081dec569f78.tar.bz2
trackermap-server-56e496c728faede7a6b26a382e87081dec569f78.zip
Fix eelink udp length field
-rw-r--r--src/org/traccar/protocol/EelinkProtocolEncoder.java2
-rw-r--r--test/org/traccar/protocol/EelinkProtocolEncoderTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/EelinkProtocolEncoder.java b/src/org/traccar/protocol/EelinkProtocolEncoder.java
index 41d76b24a..76865a039 100644
--- a/src/org/traccar/protocol/EelinkProtocolEncoder.java
+++ b/src/org/traccar/protocol/EelinkProtocolEncoder.java
@@ -65,7 +65,7 @@ public class EelinkProtocolEncoder extends BaseProtocolEncoder {
if (connectionless) {
result.writeByte('E');
result.writeByte('L');
- result.writeShort(2 + 2 + 2 + buf.readableBytes()); // length
+ result.writeShort(2 + buf.readableBytes()); // length
result.writeShort(checksum(buf.toByteBuffer()));
}
diff --git a/test/org/traccar/protocol/EelinkProtocolEncoderTest.java b/test/org/traccar/protocol/EelinkProtocolEncoderTest.java
index 96be348d1..e4502f919 100644
--- a/test/org/traccar/protocol/EelinkProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/EelinkProtocolEncoderTest.java
@@ -15,7 +15,7 @@ public class EelinkProtocolEncoderTest extends ProtocolTest {
verifyCommand(new EelinkProtocolEncoder(false), command, binary("676780000f0000010000000052454c41592c3123"));
- verifyCommand(new EelinkProtocolEncoder(true), command, binary("454c0022b41a0123456789012345676780000f0000010000000052454c41592c3123"));
+ verifyCommand(new EelinkProtocolEncoder(true), command, binary("454c001eb41a0123456789012345676780000f0000010000000052454c41592c3123"));
}