aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/WristbandProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-12-28 08:37:23 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2018-12-28 08:37:23 -0800
commit27c565546b9f0fe820af6e46a2562f4e23319ee2 (patch)
treeffa4c96a4cd206a8fbebcbcf2b396e98b82ea35a /src/org/traccar/protocol/WristbandProtocolDecoder.java
parent2b9264c4afdf62ef4d80e7cf5993ddb03374a8be (diff)
downloadtrackermap-server-27c565546b9f0fe820af6e46a2562f4e23319ee2.tar.gz
trackermap-server-27c565546b9f0fe820af6e46a2562f4e23319ee2.tar.bz2
trackermap-server-27c565546b9f0fe820af6e46a2562f4e23319ee2.zip
Wristband protocol response as text
Diffstat (limited to 'src/org/traccar/protocol/WristbandProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/WristbandProtocolDecoder.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/WristbandProtocolDecoder.java b/src/org/traccar/protocol/WristbandProtocolDecoder.java
index 84aeb6804..a19dcad31 100644
--- a/src/org/traccar/protocol/WristbandProtocolDecoder.java
+++ b/src/org/traccar/protocol/WristbandProtocolDecoder.java
@@ -16,7 +16,6 @@
package org.traccar.protocol;
import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
@@ -47,12 +46,7 @@ public class WristbandProtocolDecoder extends BaseProtocolDecoder {
if (channel != null) {
String sentence = String.format("YX%s|%s|0|{F%d#%s}\r\n", imei, version, type, data);
- ByteBuf response = Unpooled.buffer();
- response.writeBytes(new byte[]{0x00, 0x01, 0x02});
- response.writeShort(sentence.length());
- response.writeCharSequence(sentence, StandardCharsets.US_ASCII);
- response.writeBytes(new byte[]{(byte) 0xFF, (byte) 0xFE, (byte) 0xFC});
- channel.writeAndFlush(new NetworkMessage(response, channel.remoteAddress()));
+ channel.writeAndFlush(new NetworkMessage(sentence, channel.remoteAddress()));
}
}