diff options
author | Christoph Krey <c@ckrey.de> | 2018-04-16 10:45:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-16 10:45:11 +0200 |
commit | 3a602dd133b533cc69d5986d64a00fb3ed670f75 (patch) | |
tree | 97ff753db310a49ae7e53240b1db07fb8475679e /src/org/traccar/protocol/H02ProtocolDecoder.java | |
parent | 232de5f0daef98f31b28d177d991fdbfa191f195 (diff) | |
parent | 6d4b8df25c7e942b9ad594db9444fe15bcb16be9 (diff) | |
download | trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.tar.gz trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.tar.bz2 trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.zip |
Merge pull request #4 from traccar/master
upgrade to current master
Diffstat (limited to 'src/org/traccar/protocol/H02ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 4414870d2..9764adf04 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -101,8 +101,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { private Position decodeBinary(ChannelBuffer buf, Channel channel, SocketAddress remoteAddress) { - Position position = new Position(); - position.setProtocol(getProtocolName()); + Position position = new Position(getProtocolName()); buf.readByte(); // marker @@ -267,8 +266,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { return null; } - Position position = new Position(); - position.setProtocol(getProtocolName()); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); if (parser.hasNext()) { @@ -348,8 +346,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { return null; } - Position position = new Position(); - position.setProtocol(getProtocolName()); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() @@ -388,8 +385,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { return null; } - Position position = new Position(); - position.setProtocol(getProtocolName()); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() @@ -422,8 +418,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { return null; } - Position position = new Position(); - position.setProtocol(getProtocolName()); + Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() @@ -461,7 +456,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { switch (marker) { case "*": - String sentence = buf.toString(StandardCharsets.US_ASCII); + String sentence = buf.toString(StandardCharsets.US_ASCII).trim(); int typeStart = sentence.indexOf(',', sentence.indexOf(',') + 1) + 1; int typeEnd = sentence.indexOf(',', typeStart); if (typeEnd > 0) { |