From ece4c0e07827f001f998190eaa9fc9522ecb38ac Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 2 Jun 2017 22:45:46 +1200 Subject: Split FlexComm digital inputs and outputs --- src/org/traccar/protocol/FlexCommProtocolDecoder.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/org/traccar') 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()); -- cgit v1.2.3