diff options
author | Kevin Goos <kevingoos@telenet.be> | 2018-03-20 09:14:19 +0100 |
---|---|---|
committer | Kevin Goos <kevingoos@telenet.be> | 2018-03-20 09:14:19 +0100 |
commit | 98e9a26fd916bcdace022af1d9f7dd80d1a2d2fe (patch) | |
tree | c0823007bc863ac0a48bd5902f0b4eb3f076af64 /src | |
parent | 37f9c76f4690b73f44c5dfbfe77509c5348b6401 (diff) | |
download | traccar-server-98e9a26fd916bcdace022af1d9f7dd80d1a2d2fe.tar.gz traccar-server-98e9a26fd916bcdace022af1d9f7dd80d1a2d2fe.tar.bz2 traccar-server-98e9a26fd916bcdace022af1d9f7dd80d1a2d2fe.zip |
Fixed formatting
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/LaipacProtocolDecoder.java | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java index 7f26f225b..4fc0201ef 100644 --- a/src/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java @@ -35,34 +35,35 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN = new PatternBuilder() .text("$AVRMC,") - .expression("([^,]+),") // identifier - .number("(dd)(dd)(dd),") // time (hhmmss) - .expression("([AVRPavrp]),") // validity - .number("(dd)(dd.d+),") // latitude + .expression("([^,]+),") // identifier + .number("(dd)(dd)(dd),") // time (hhmmss) + .expression("([AVRPavrp]),") // validity + .number("(dd)(dd.d+),") // latitude .expression("([NS]),") - .number("(ddd)(dd.d+),") // longitude + .number("(ddd)(dd.d+),") // longitude .number("([EW]),") - .number("(d+.d+),") // speed - .number("(d+.d+),") // course - .number("(dd)(dd)(dd),") // date (ddmmyy) - .expression("([abZXTSMHFE86430]),") // event code + .number("(d+.d+),") // speed + .number("(d+.d+),") // course + .number("(dd)(dd)(dd),") // date (ddmmyy) + .expression("([abZXTSMHFE86430]),") // event code .number("(d+)").expression("(\\.?)").number("(d*),") // battery voltage - .number("(d+),") // current mileage - .number("(d),") // GPS on/off (1 = on, 0 = off) - .number("(d+),") // Analog port 1 - .number("(d+)") // Analog port 2 - .expression(",([0-9a-fA-F]{4})") // Cell 1 - Cell Net Code - .expression("([0-9a-fA-F]{4}),") // Cell 1 - Cell ID Code - .number("(d{3})") // Cell 2 - Country Code - .number("(d{3})") // Cell 2 - Operator Code + .number("(d+),") // current mileage + .number("(d),") // GPS on/off (1 = on, 0 = off) + .number("(d+),") // Analog port 1 + .number("(d+)") // Analog port 2 + .expression(",([0-9a-fA-F]{4})") // Cell 1 - Cell Net Code + .expression("([0-9a-fA-F]{4}),") // Cell 1 - Cell ID Code + .number("(d{3})") // Cell 2 - Country Code + .number("(d{3})") // Cell 2 - Operator Code .optional(4) .text("*") - .number("(xx)") // checksum + .number("(xx)") // checksum .compile(); @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + String sentence = (String) msg; if (sentence.startsWith("$ECHK") && channel != null) { |