diff options
author | seym45 <seym45@gmail.com> | 2023-07-26 11:11:15 +0400 |
---|---|---|
committer | seym45 <seym45@gmail.com> | 2023-07-26 11:13:50 +0400 |
commit | 18c1e761fd203c994445ac85e808ca6f672d0ec5 (patch) | |
tree | 1b51165edddf88b961382e39da9486735d07b5b7 | |
parent | 9b680956acccb5bd64b6c9c6eee1428e93387719 (diff) | |
download | trackermap-server-18c1e761fd203c994445ac85e808ca6f672d0ec5.tar.gz trackermap-server-18c1e761fd203c994445ac85e808ca6f672d0ec5.tar.bz2 trackermap-server-18c1e761fd203c994445ac85e808ca6f672d0ec5.zip |
Resolve suggestions
- Define MSG_POSITION_REQUEST
- Change comment "calibration" to "checksum"
-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; } |