aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java
diff options
context:
space:
mode:
authorStefan Clark <stefanclark@gmail.com>2022-07-27 15:47:18 +0100
committerStefan Clark <stefan.clark@jlgb.org>2022-07-27 18:37:29 +0100
commitde2219565e4a61aa0d64b03650ec36ef6d17de93 (patch)
treeb36651dd2f94895236fe0b3ffcf022c2dd60ee9b /src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java
parente91402cddad8763658572eb8e383fa8a16d69190 (diff)
downloadtrackermap-server-de2219565e4a61aa0d64b03650ec36ef6d17de93.tar.gz
trackermap-server-de2219565e4a61aa0d64b03650ec36ef6d17de93.tar.bz2
trackermap-server-de2219565e4a61aa0d64b03650ec36ef6d17de93.zip
Update Xexun2 Encoder
Diffstat (limited to 'src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java
index 3c81ec27f..8deb2328b 100644
--- a/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java
@@ -42,13 +42,11 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder {
}
public static final int MSG_POSITION = 0x14;
- public static final int MSG_COMMAND = 0x07;
private void sendResponse(Channel channel, int type, int index, ByteBuf imei) {
if (channel != null) {
ByteBuf response = Unpooled.buffer();
- response.writeByte(0xfa);
- response.writeByte(0xaf);
+ response.writeShort(Xexun2ProtocolEncoder.FLAG);
response.writeShort(type);
response.writeShort(index);
@@ -57,8 +55,7 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder {
response.writeShort(0xfffe); // checksum
response.writeByte(1); // response
- response.writeByte(0xfa);
- response.writeByte(0xaf);
+ response.writeShort(Xexun2ProtocolEncoder.FLAG);
channel.writeAndFlush(new NetworkMessage(response, channel.remoteAddress()));
}
@@ -100,7 +97,7 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- if (type != MSG_COMMAND) {
+ if (type != Xexun2ProtocolEncoder.MSG_COMMAND) {
sendResponse(channel, type, index, imei);
}