diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-08-28 02:27:03 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-08-28 02:27:03 +1200 |
commit | 2e6c2fd5a6ed500f3d169131295fc8c5923e81b2 (patch) | |
tree | 5444006b08a30f0c95f402264d6951ea3a99559d /src/org/traccar/protocol/MeiligaoProtocolDecoder.java | |
parent | 29f7a148e1ca09e0b0667b42776fe6d5e9c26502 (diff) | |
download | trackermap-server-2e6c2fd5a6ed500f3d169131295fc8c5923e81b2.tar.gz trackermap-server-2e6c2fd5a6ed500f3d169131295fc8c5923e81b2.tar.bz2 trackermap-server-2e6c2fd5a6ed500f3d169131295fc8c5923e81b2.zip |
Implement VT1000 inputs (fix #3477)
Diffstat (limited to 'src/org/traccar/protocol/MeiligaoProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 8 |
1 files changed, 7 insertions, 1 deletions
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); } |