diff options
author | jon-stumpf <jon.stumpf@gmail.com> | 2017-02-21 23:30:45 -0500 |
---|---|---|
committer | jon-stumpf <jon.stumpf@gmail.com> | 2017-02-21 23:30:45 -0500 |
commit | b07810ad2567088dee585e5fcc18f5a3b8881285 (patch) | |
tree | d3be218f56ca4d5ff2550619238f318ada563878 | |
parent | a36edc4f713bc0e3642fbd60787c0094a6452830 (diff) | |
download | trackermap-server-b07810ad2567088dee585e5fcc18f5a3b8881285.tar.gz trackermap-server-b07810ad2567088dee585e5fcc18f5a3b8881285.tar.bz2 trackermap-server-b07810ad2567088dee585e5fcc18f5a3b8881285.zip |
Fixed TotemProtocol to only record vdop and pdop while parsing PATTERN1; Increased maximum MethodLength to 160;
-rw-r--r-- | checkstyle.xml | 5 | ||||
-rw-r--r-- | src/org/traccar/protocol/TotemProtocolDecoder.java | 15 |
2 files changed, 14 insertions, 6 deletions
diff --git a/checkstyle.xml b/checkstyle.xml index 9d0314b06..7d52f4225 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -67,7 +67,10 @@ <module name="LineLength"> <property name="max" value="120"/> </module> - <module name="MethodLength"/> + <module name="MethodLength"> + <property name="tokens" value="METHOD_DEF"/> + <property name="max" value="160"/> + </module> <module name="ParameterNumber"/> <!-- Checks for whitespace --> diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index db25a3f17..3f8d66a2b 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -50,9 +50,9 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { .number("(dd)(dd)(dd)") // date .expression("[^*]*").text("*") .number("xx|") // checksum - .number("(d+.d+)|") // pdop + .number("(d+.d+)|") // pdop .number("(d+.d+)|") // hdop - .number("(d+.d+)|") // vdop + .number("(d+.d+)|") // vdop .number("(d+)|") // io status .number("d+|") // time .number("d") // charged @@ -242,9 +242,14 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { } position.setTime(dateBuilder.getDate()); - position.set("pdop", parser.next()); - position.set(Position.KEY_HDOP, parser.next()); - position.set("vdop", parser.next()); + if (pattern == PATTERN1) { + position.set("pdop", parser.next()); + position.set(Position.KEY_HDOP, parser.next()); + position.set("vdop", parser.next()); + } else if (pattern == PATTERN2) { + position.set(Position.KEY_HDOP, parser.next()); + } + position.set(Position.PREFIX_IO + 1, parser.next()); position.set(Position.KEY_BATTERY, parser.next()); position.set(Position.KEY_POWER, parser.nextDouble()); |