diff options
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java index 9521a1248..13e171dfa 100644 --- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java @@ -521,6 +521,31 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_OUTPUT, Integer.parseInt(values[index++])); } + if (BitUtil.check(mask, 19)) { + index += 1; // alert id + } + + if (BitUtil.check(mask, 20)) { + index += 1; // alert modifier + } + + if (BitUtil.check(mask, 21)) { + index += 1; // alert data + } + + if (BitUtil.check(mask, 22)) { + index += 1; // reserved + } + + if (BitUtil.check(mask, 23)) { + int assignMask = Integer.parseInt(values[index++], 16); + for (int i = 0; i <= 30; i++) { + if (BitUtil.check(assignMask, i)) { + position.set(Position.PREFIX_IO + (i + 1), values[index++]); + } + } + } + return position; } |