aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-06-02 22:45:46 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-06-02 22:45:46 +1200
commitece4c0e07827f001f998190eaa9fc9522ecb38ac (patch)
tree7e7c3fa10fb40098944d6abe5c3bcad56100ee43 /src/org
parent77a475886aea9604030efd5e5deeb634990312f3 (diff)
downloadtrackermap-server-ece4c0e07827f001f998190eaa9fc9522ecb38ac.tar.gz
trackermap-server-ece4c0e07827f001f998190eaa9fc9522ecb38ac.tar.bz2
trackermap-server-ece4c0e07827f001f998190eaa9fc9522ecb38ac.zip
Split FlexComm digital inputs and outputs
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/FlexCommProtocolDecoder.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/FlexCommProtocolDecoder.java b/src/org/traccar/protocol/FlexCommProtocolDecoder.java
index 33b4c0abb..f401145b9 100644
--- a/src/org/traccar/protocol/FlexCommProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlexCommProtocolDecoder.java
@@ -53,8 +53,8 @@ public class FlexCommProtocolDecoder extends BaseProtocolDecoder {
.number("(ddd)") // mnc
.number("(x{6})") // lac
.number("(x{6})") // cid
- .expression("([01]{3})") // input
- .expression("([01]{2})") // output
+ .expression("([01])([01])([01])") // input
+ .expression("([01])([01])") // output
.number("(ddd)") // fuel
.number("(d{4})") // temperature
.number("(ddd)") // battery
@@ -104,8 +104,14 @@ public class FlexCommProtocolDecoder extends BaseProtocolDecoder {
position.setNetwork(new Network(CellTower.from(
parser.nextInt(), parser.nextInt(), parser.nextHexInt(), parser.nextHexInt())));
- position.set(Position.KEY_INPUT, parser.nextBinInt());
- position.set(Position.KEY_OUTPUT, parser.nextBinInt());
+ for (int i = 1; i <= 3; i++) {
+ position.set(Position.PREFIX_IN + i, parser.nextInt());
+ }
+
+ for (int i = 1; i <= 2; i++) {
+ position.set(Position.PREFIX_OUT + i, parser.nextInt());
+ }
+
position.set(Position.KEY_FUEL_LEVEL, parser.nextInt());
position.set(Position.PREFIX_TEMP + 1, parseSignedValue(parser, 0));
position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());