aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
diff options
context:
space:
mode:
authorHans van den Elsen <hans.elsen@esds.nl>2016-03-11 22:16:25 +0100
committerHans van den Elsen <hans.elsen@esds.nl>2016-03-11 22:16:25 +0100
commit4606737cc07b736f9c8f98ae680b928c94c082c8 (patch)
treebdd29b24a16403b1e8a3d7cd4325391063b34b8a /src/org/traccar/protocol/MeiligaoProtocolDecoder.java
parent3ced99384b1967f5cde9abdf30c1c0184a5ae3f6 (diff)
parentab5d21e16ac44957e04da0f06daf148af95e96be (diff)
downloadtrackermap-server-4606737cc07b736f9c8f98ae680b928c94c082c8.tar.gz
trackermap-server-4606737cc07b736f9c8f98ae680b928c94c082c8.tar.bz2
trackermap-server-4606737cc07b736f9c8f98ae680b928c94c082c8.zip
Merge remote-tracking branch 'refs/remotes/tananaev/master'
Diffstat (limited to 'src/org/traccar/protocol/MeiligaoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index cb2139a00..5c17aab61 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -54,23 +54,19 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
.number("|(xxxx)?") // state
.groupBegin()
.number("|(xxxx),(xxxx)") // adc
+ .number("(?:,(xxxx),(xxxx),(xxxx),(xxxx),(xxxx),(xxxx))?")
.groupBegin()
- .number(",(xxxx),(xxxx),(xxxx),(xxxx),(xxxx),(xxxx)")
- .groupEnd("?")
- .groupBegin()
- .text("|")
- .groupBegin()
- .number("(x{16})") // cell
+ .number("|x{16}") // cell
.number("|(xx)") // gsm
- .number("|(x{8})|") // odometer
- .number("(x{9})") // odometer
+ .number("|(x{8})") // odometer
+ .or()
+ .number("|(x{9})") // odometer
.groupBegin()
.number("|(x{5,})") // rfid
.groupEnd("?")
.groupEnd("?")
.groupEnd("?")
.groupEnd("?")
- .groupEnd("?")
.any()
.compile();
@@ -283,15 +279,14 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
}
}
- position.set(Event.KEY_CID, parser.next());
-
if (parser.hasNext()) {
position.set(Event.KEY_GSM, parser.nextInt(16));
}
if (parser.hasNext()) {
position.set(Event.KEY_ODOMETER, parser.nextInt(16));
- } else if (parser.hasNext()) {
+ }
+ if (parser.hasNext()) {
position.set(Event.KEY_ODOMETER, parser.nextInt(16));
}