aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/T55ProtocolDecoder.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java
index faf9c4b7d..a41da427a 100644
--- a/src/org/traccar/protocol/T55ProtocolDecoder.java
+++ b/src/org/traccar/protocol/T55ProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2017 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,9 +50,10 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
.expression("[^,]+")
.number(",(d+)") // satellites
.number(",(d+)") // imei
- .number(",([01])") // ignition
+ .expression(",([01])") // ignition
.number(",(d+)") // fuel
.number(",(d+)").optional(5) // battery
+ .number("((?:,d+)+)?") // parameters
.any()
.compile();
@@ -139,6 +140,13 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, parser.nextInt());
}
+ if (parser.hasNext()) {
+ String[] parameters = parser.next().split(",");
+ for (int i = 1; i < parameters.length; i++) {
+ position.set(Position.PREFIX_IO + i, parameters[i]);
+ }
+ }
+
if (deviceSession != null) {
return position;
} else {