aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-12-21 22:04:03 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2012-12-21 22:04:03 +1300
commitfe9f9b034713cb98531d73698a65bd03d18a771c (patch)
treee6c9c976951b018936fa849deeae5fd96afb3bb3 /src/org/traccar/protocol/MeiligaoProtocolDecoder.java
parentb10a929a464eb866b47d08619d3f792fb00a92e4 (diff)
downloadtrackermap-server-fe9f9b034713cb98531d73698a65bd03d18a771c.tar.gz
trackermap-server-fe9f9b034713cb98531d73698a65bd03d18a771c.tar.bz2
trackermap-server-fe9f9b034713cb98531d73698a65bd03d18a771c.zip
Added GT06 protocol (fix #100)
Diffstat (limited to 'src/org/traccar/protocol/MeiligaoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index f1332ddf9..3d8fbef75 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -106,9 +106,7 @@ public class MeiligaoProtocolDecoder extends GenericProtocolDecoder {
sendBuf.writeBytes(array);
sendBuf.writeShort(0x4000);
sendBuf.writeByte(0x01);
- array = new byte[sendBuf.readableBytes()];
- sendBuf.getBytes(0, array);
- sendBuf.writeShort(Crc.crc16X25Ccitt(array));
+ sendBuf.writeShort(Crc.crc16X25Ccitt(sendBuf.toByteBuffer()));
sendBuf.writeByte('\r');
sendBuf.writeByte('\n');
if (channel != null) {