aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
diff options
context:
space:
mode:
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 4696343d6..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.crc16Ccitt(array));
+ sendBuf.writeShort(Crc.crc16X25Ccitt(sendBuf.toByteBuffer()));
sendBuf.writeByte('\r');
sendBuf.writeByte('\n');
if (channel != null) {