aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
index 924725041..2185b707e 100644
--- a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
@@ -44,9 +44,9 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder {
.text("$EAVSYS,")
.expression("([^,]+),") // identifier
.expression("([0-9]+),") // iccid
- .expression("(\\+?[0-9]*),") // sim phone number
+ .expression("(\\+?[0-9]+)?,") // sim phone number
.expression("(?:[^,]*),") // owner name
- .expression("([^,]*)") // firmware version
+ .expression("([^,]*)?") // firmware version
.text("*")
.number("(xx)") // checksum
.compile();
@@ -189,16 +189,8 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, null);
position.set(Position.KEY_ICCID, parser.next());
-
- String phoneNumber = parser.next();
- if (!phoneNumber.isEmpty()) {
- position.set(Position.KEY_PHONE_NUMBER, phoneNumber);
- }
-
- String firmware = parser.next();
- if (!firmware.isEmpty()) {
- position.set(Position.KEY_VERSION_FW, firmware);
- }
+ position.set(Position.KEY_PHONE, parser.next());
+ position.set(Position.KEY_VERSION_FW, parser.next());
return position;
}