From e104f5636d53311dfd91cafaa2cdea65260ae7dc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Apr 2017 16:42:23 +1200 Subject: Minor Enfora encoder cleanup --- src/org/traccar/protocol/EnforaProtocolEncoder.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/EnforaProtocolEncoder.java b/src/org/traccar/protocol/EnforaProtocolEncoder.java index 56e56942c..e7da87388 100644 --- a/src/org/traccar/protocol/EnforaProtocolEncoder.java +++ b/src/org/traccar/protocol/EnforaProtocolEncoder.java @@ -1,6 +1,6 @@ /* * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Jose Castellanos + * Copyright 2017 Jose Castellanos * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,12 +32,10 @@ public class EnforaProtocolEncoder extends StringProtocolEncoder { byte[] contentBytes = content.getBytes(); - buf.writeShort(contentBytes.length + 6); // Byte 0 Byte 1 Length - buf.writeByte(0x00); // Byte 2 Api Number Sequence - buf.writeByte(0x00); // Byte 3 Api Number Sequence - buf.writeByte(0x04); // Byte 4 Command Type 4 AT Command - buf.writeByte(0x00); // Byte 5 API Optional Header - // Byte 6+m AT Command + buf.writeShort(contentBytes.length + 6); + buf.writeShort(0); // index + buf.writeByte(0x04); // command type + buf.writeByte(0); // optional header buf.writeBytes(content.getBytes(StandardCharsets.UTF_8)); return buf; -- cgit v1.2.3