aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/traccar/protocol/GatorProtocolEncoder.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
index df85a712c..0d4353c8f 100644
--- a/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/GatorProtocolEncoder.java
@@ -62,12 +62,24 @@ public class GatorProtocolEncoder extends BaseProtocolEncoder {
return encodedId.toString();
}
+ private static String getCalibrationByteFromHexString(String data) {
+ String response = "";
+ int calib = 0;
+ int length = data.length() / 2;
+ for (int i = 0; i < length; i++) {
+ calib = calib ^ Integer.parseInt(data.substring(i * 2, i * 2 + 2), 16);
+ }
+ response = Integer.toHexString(calib).toUpperCase();
+ response = String.format("%2s", response).replace(' ', '0');
+ return response;
+ }
private ByteBuf encodeContent(long deviceId, String mainOrder, String content) {
// FIXME: implement this method
return null;
}
+
@Override
protected Object encodeCommand(Command command) {