aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-29 15:09:52 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-29 15:09:52 +1300
commit0d65586e0011f44d7597a0e332a0a1b83276607c (patch)
tree499ff94d48578eacf63451426f5d2380c32fa938 /src
parent9a72eea4bfe43dba9512cfef744d539d5f78ad49 (diff)
downloadtraccar-server-0d65586e0011f44d7597a0e332a0a1b83276607c.tar.gz
traccar-server-0d65586e0011f44d7597a0e332a0a1b83276607c.tar.bz2
traccar-server-0d65586e0011f44d7597a0e332a0a1b83276607c.zip
Fix a problem in GoSafe decoder
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/GoSafeProtocolDecoder.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java
index e1321633e..7ec395672 100644
--- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java
+++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java
@@ -22,10 +22,7 @@ import java.util.List;
import java.util.regex.Pattern;
import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.helper.BitUtil;
-import org.traccar.helper.DateBuilder;
-import org.traccar.helper.Parser;
-import org.traccar.helper.PatternBuilder;
+import org.traccar.helper.*;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -56,7 +53,7 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
.number("(d+);") // satellites
.number("([NS])(d+.d+);") // latitude
.number("([EW])(d+.d+);") // longitude
- .number("(d+);") // speed
+ .number("(d+)?;") // speed
.number("(d+);") // course
.number("(d+);") // altitude
.number("(d+.d+)") // hdop
@@ -89,7 +86,8 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
.text("ETD:").expression("[^,],?")
.groupEnd("?")
.groupBegin()
- .text("OBD:").expression("[^,],?")
+ .text("OBD:")
+ .number("(x+),?")
.groupEnd("?")
.groupBegin()
.text("FUL:").expression("[^,],?")
@@ -127,6 +125,10 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
position.set(Event.KEY_STATUS, status);
}
+ if (parser.hasNext()) {
+ position.set("obd", parser.next());
+ }
+
return position;
}