diff options
author | Ivan Muratov <binakot@gmail.com> | 2017-11-03 15:10:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-03 15:10:45 +0300 |
commit | 4e07d664cac49fcbb47376471ef9f4d770293ba9 (patch) | |
tree | 7eaa0886dcb6e44cf4d4aa549abbbaca6533f654 /src/org/traccar/protocol/DwayProtocolDecoder.java | |
parent | 74cea90707321c775c11e9cfb91269f63ab4476f (diff) | |
parent | c62dd84c7ad4061c0c6d8a521c63857ccde461ba (diff) | |
download | trackermap-server-4e07d664cac49fcbb47376471ef9f4d770293ba9.tar.gz trackermap-server-4e07d664cac49fcbb47376471ef9f4d770293ba9.tar.bz2 trackermap-server-4e07d664cac49fcbb47376471ef9f4d770293ba9.zip |
Merge branch 'master' into master
Diffstat (limited to 'src/org/traccar/protocol/DwayProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/DwayProtocolDecoder.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/DwayProtocolDecoder.java b/src/org/traccar/protocol/DwayProtocolDecoder.java index 993aa91b2..767b35c72 100644 --- a/src/org/traccar/protocol/DwayProtocolDecoder.java +++ b/src/org/traccar/protocol/DwayProtocolDecoder.java @@ -42,15 +42,16 @@ public class DwayProtocolDecoder extends BaseProtocolDecoder { .number("(-?d+.d+),") // latitude .number("(-?d+.d+),") // longitude .number("(-?d+),") // altitude - .number("(d+.d+),") // speed + .number(" ?(d+.d+),") // speed .number("(d+),") // course .number("([01]{4}),") // input .number("([01]{4}),") // output - .number("([01])([01])([01])([01]),") // flags + .number("([01]+),") // flags .number("(d+),") // battery .number("(d+),") // adc1 .number("(d+),") // adc2 .number("(d+)") // driver + .any() .compile(); @Override @@ -79,6 +80,7 @@ public class DwayProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); + position.setValid(true); position.setTime(parser.nextDateTime()); position.setLatitude(parser.nextDouble()); position.setLongitude(parser.nextDouble()); @@ -89,15 +91,6 @@ public class DwayProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_INPUT, parser.nextBinInt()); position.set(Position.KEY_OUTPUT, parser.nextBinInt()); - position.setValid(parser.next().equals("1")); - - position.set(Position.KEY_IGNITION, parser.next().equals("1")); - position.set(Position.KEY_CHARGE, parser.next().equals("1")); - - if (parser.next().equals("1")) { - position.set(Position.KEY_ALARM, Position.ALARM_SHOCK); - } - position.set(Position.KEY_BATTERY, parser.nextInt() * 0.001); position.set(Position.PREFIX_ADC + 1, parser.nextInt() * 0.001); position.set(Position.PREFIX_ADC + 2, parser.nextInt() * 0.001); |