diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-16 22:15:14 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-16 22:15:14 +1300 |
commit | 2276cfdcf4c2cedf5bef33ca0a68446b70aacb33 (patch) | |
tree | e4c111340d2af64d84e2cd567993c271bd41b534 | |
parent | fd98c290b185ef51220527aeb7c69df8845c549b (diff) | |
download | traccar-server-2276cfdcf4c2cedf5bef33ca0a68446b70aacb33.tar.gz traccar-server-2276cfdcf4c2cedf5bef33ca0a68446b70aacb33.tar.bz2 traccar-server-2276cfdcf4c2cedf5bef33ca0a68446b70aacb33.zip |
Another progress fix
-rw-r--r-- | src/org/traccar/ServerManager.java | 2 | ||||
-rw-r--r-- | src/org/traccar/protocol/ProgressProtocolDecoder.java | 6 | ||||
-rwxr-xr-x | tools/hex.sh | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 5a9a4cc8b..23b067712 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -411,7 +411,7 @@ public class ServerManager { TrackerServer server = new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 0, 0)); + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, 4, 0)); pipeline.addLast("objectDecoder", new ProgressProtocolDecoder(ServerManager.this)); } }; diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java index 525aff49e..d3f582225 100644 --- a/src/org/traccar/protocol/ProgressProtocolDecoder.java +++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java @@ -65,7 +65,7 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { /** * Hack to load last index from database */ - /*private void loadLastIndex() { + private void loadLastIndex() { try { Properties p = getServerManager().getProperties(); AdvancedConnection connection = new AdvancedConnection( @@ -79,7 +79,7 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { } } catch(Exception error) { } - }*/ + } /** * Request archive messages @@ -127,7 +127,7 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder { } // Position - else if (/*deviceId != 0 &&*/ (type == MSG_POINT || type == MSG_ALARM || type == MSG_LOGMSG)) { + else if (deviceId != 0 && (type == MSG_POINT || type == MSG_ALARM || type == MSG_LOGMSG)) { List<Position> positions = new LinkedList<Position>(); int recordCount = 1; diff --git a/tools/hex.sh b/tools/hex.sh index 45f6b11bc..fb0fa1a23 100755 --- a/tools/hex.sh +++ b/tools/hex.sh @@ -1 +1 @@ -echo 78780d0103534190360660610001e0cd0d0a | perl -ne 's/([0-9a-f]{2})/print chr hex $1/gie' | nc -v -w 10 localhost 5023 +echo 0a0038006cdc0000336bf6506b89aa27f4299f1a000000008c0a343a120f30303030010000000000000008000000302e70720200000004000973c80f00000000 | perl -ne 's/([0-9a-f]{2})/print chr hex $1/gie' | nc -v -w 10 localhost 5012 |