diff options
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/GatorProtocolDecoder.java | 1 | ||||
-rw-r--r-- | src/main/java/org/traccar/protocol/GatorProtocolEncoder.java | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/GatorProtocolDecoder.java b/src/main/java/org/traccar/protocol/GatorProtocolDecoder.java index 644caee81..f7da5dc75 100644 --- a/src/main/java/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/GatorProtocolDecoder.java @@ -37,6 +37,7 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { } public static final int MSG_HEARTBEAT = 0x21; + public static final int MSG_POSITION_REQUEST = 0x30; public static final int MSG_POSITION_DATA = 0x80; public static final int MSG_ROLLCALL_RESPONSE = 0x81; public static final int MSG_ALARM_DATA = 0x82; diff --git a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java index c4f06dbc5..f2c522067 100644 --- a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java @@ -60,9 +60,7 @@ public class GatorProtocolEncoder extends BaseProtocolEncoder { buf.writeByte(0x24); buf.writeByte(mainOrder); buf.writeByte(0x00); - - int length = 4 + 1 + 1; // ip 4 bytes, calibration byte and end byte - buf.writeByte(length); + buf.writeByte(4 + 1 + 1); // ip 4 bytes, checksum and end byte ByteBuf pseudoIPAddress = encodeId(deviceId); buf.writeBytes(pseudoIPAddress); @@ -80,7 +78,7 @@ public class GatorProtocolEncoder extends BaseProtocolEncoder { switch (command.getType()) { case Command.TYPE_POSITION_SINGLE: - return encodeContent(command.getDeviceId(), 0x30); + return encodeContent(command.getDeviceId(), GatorProtocolDecoder.MSG_POSITION_REQUEST); default: return null; } |