diff options
Diffstat (limited to 'src/org/traccar/protocol/TotemProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/TotemProtocolDecoder.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 5a2c203d2..06a1fbc41 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -245,6 +245,9 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { int io = parser.nextBinInt(); if (pattern == PATTERN1) { + if (BitUtil.check(io, 0)) { + position.set(Position.KEY_ALARM, Position.ALARM_SOS); + } for (int i = 1; i <= 4; i++) { position.set(Position.PREFIX_IN + i, BitUtil.check(io, 3 + i)); } @@ -364,7 +367,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { String sentence = (String) msg; Pattern pattern = PATTERN3; - if (sentence.indexOf("A") == 6) { + if (sentence.charAt(2) == '0') { pattern = PATTERN4; } else if (sentence.contains("$GPRMC")) { pattern = PATTERN1; |