aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-15 14:30:37 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-15 14:30:37 +1300
commit8ac74d53d687641b7af79e6ca3a84d8851b46236 (patch)
treeee4d6764dd23e18667aaa63561fac6d48f08608c /src/org/traccar
parentcfe237cf26c6309b8431b3b81d589628ae363804 (diff)
downloadtrackermap-server-8ac74d53d687641b7af79e6ca3a84d8851b46236.tar.gz
trackermap-server-8ac74d53d687641b7af79e6ca3a84d8851b46236.tar.bz2
trackermap-server-8ac74d53d687641b7af79e6ca3a84d8851b46236.zip
Fix LBS info for some decoders
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/FlextrackProtocolDecoder.java4
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java12
2 files changed, 9 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/FlextrackProtocolDecoder.java b/src/org/traccar/protocol/FlextrackProtocolDecoder.java
index 363d5502c..bc9825b49 100644
--- a/src/org/traccar/protocol/FlextrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlextrackProtocolDecoder.java
@@ -125,8 +125,8 @@ public class FlextrackProtocolDecoder extends BaseProtocolDecoder {
position.setAltitude(parser.nextInt());
position.set(Event.KEY_HDOP, parser.nextInt() * 0.1);
- position.set(Event.KEY_CID, parser.next());
- position.set(Event.KEY_LAC, parser.next());
+ position.set(Event.KEY_CID, parser.nextInt(16));
+ position.set(Event.KEY_LAC, parser.nextInt(16));
position.set(Event.KEY_ODOMETER, parser.nextInt());
return position;
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 29884bb00..06c548669 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -116,7 +116,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
.text(",")
.number("(0ddd)?,") // mcc
.number("(0ddd)?,") // mnc
- .number("(xxxx|x{8})?,") // loc
+ .number("(xxxx|x{8})?,") // lac
.number("(xxxx)?,") // cell
.groupBegin()
.number("(d+.d)?,") // odometer
@@ -215,10 +215,12 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, null);
}
- position.set(Event.KEY_MCC, parser.next());
- position.set(Event.KEY_MNC, parser.next());
- position.set(Event.KEY_LAC, parser.next());
- position.set(Event.KEY_CID, parser.next());
+ if (parser.hasNext(4)) {
+ position.set(Event.KEY_MCC, parser.nextInt());
+ position.set(Event.KEY_MNC, parser.nextInt());
+ position.set(Event.KEY_LAC, parser.nextInt(16));
+ position.set(Event.KEY_CID, parser.nextInt(16));
+ }
position.set(Event.KEY_ODOMETER, parser.next());
position.set(Event.KEY_BATTERY, parser.next());