You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
//
|
|
// ±êÖ¾ÎïͨÐÅ - ·é»ð̨ - ZigBee/IR
|
|
//
|
|
|
|
#include "AlarmTowerCommand.h"
|
|
|
|
AlarmTowerCommand::AlarmTowerCommand()
|
|
{
|
|
SetDevice(CommandData::Devices::AlarmTower);
|
|
}
|
|
|
|
byte* AlarmTowerCommand::CMD_DefaultIRAlarm()
|
|
{
|
|
SetCommand(0x03, 0x05, 0x14, 0x45, 0xDE, 0x92);
|
|
return GetIRCommandArray();
|
|
}
|
|
|
|
byte* AlarmTowerCommand::CMD_IRAlarm(byte d1, byte d2, byte d3, byte d4, byte d5, byte d6)
|
|
{
|
|
SetCommand(d1, d2, d3, d4, d5, d6);
|
|
return GetIRCommandArray();
|
|
}
|
|
|
|
byte* AlarmTowerCommand::CMD_ChangeOpenCode_1to3(byte d1, byte d2, byte d3)
|
|
{
|
|
SetCommand(0x10, d1, d2, d3);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* AlarmTowerCommand::CMD_ChangeOpenCode_4to6(byte d4, byte d5, byte d6)
|
|
{
|
|
SetCommand(0x11, d4, d5, d6);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
byte* AlarmTowerCommand::CMD_QueryRescuePosition()
|
|
{
|
|
SetCommand(0x09);
|
|
return GetCommandArray();
|
|
}
|
|
|
|
bool AlarmTowerCommand::IsAlarmTowerCommand(byte* cmd)
|
|
{
|
|
return ((cmd[1] == CommandData::Devices::AlarmTower) && (cmd[2] == 0x01));
|
|
}
|
|
|
|
byte AlarmTowerCommand::ReadRescuePosition(byte* cmd)
|
|
{
|
|
if (!IsAlarmTowerCommand(cmd))
|
|
return 0xFF;
|
|
return cmd[3];
|
|
}
|