From 2e6c2fd5a6ed500f3d169131295fc8c5923e81b2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 28 Aug 2017 02:27:03 +1200 Subject: Implement VT1000 inputs (fix #3477) --- src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 1442f162b..b9725337b 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -359,7 +359,13 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); if (command == MSG_ALARM) { - position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte())); + short alarmCode = buf.readUnsignedByte(); + position.set(Position.KEY_ALARM, decodeAlarm(alarmCode)); + if (alarmCode >= 0x02 && alarmCode <= 0x05) { + position.set(Position.PREFIX_IN + alarmCode, 1); + } else if (alarmCode >= 0x32 && alarmCode <= 0x35) { + position.set(Position.PREFIX_IN + (alarmCode - 0x30), 0); + } } else if (command == MSG_POSITION_LOGGED) { buf.skipBytes(6); } -- cgit v1.2.3