aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-10-20 15:05:41 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-10-20 15:05:41 +1300
commit8876e964cf26a090d11fd855642c95bc02a17c7f (patch)
tree2bcedba458db162dcfefa07aac0c77bd8f4504ad /src/org/traccar/ServerManager.java
parent6984cc9c14cf8dd44b946dd1624601ce2c0edf30 (diff)
downloadtrackermap-server-8876e964cf26a090d11fd855642c95bc02a17c7f.tar.gz
trackermap-server-8876e964cf26a090d11fd855642c95bc02a17c7f.tar.bz2
trackermap-server-8876e964cf26a090d11fd855642c95bc02a17c7f.zip
Support PT502 binary messages (fix #825)
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 2d3788720..33d364cc4 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -497,17 +497,16 @@ public class ServerManager {
private void initPt502Server(String protocol) throws SQLException {
if (isProtocolEnabled(properties, protocol)) {
- serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
- byte delimiter[] = { (byte) '\r', (byte) '\n' };
- pipeline.addLast("frameDecoder",
- new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter)));
+ pipeline.addLast("frameDecoder", new Pt502FrameDecoder());
pipeline.addLast("stringDecoder", new StringDecoder());
- pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(ServerManager.this));
}
- });
+ };
+ server.setEndianness(ByteOrder.LITTLE_ENDIAN);
+ serverList.add(server);
}
}