void runAlarm() { led.ledOn(!isActive.getState()); if (isActive.getState()) { std::cout << "Activated!" << std::endl; door.close(); if ((sensor.read() > LIGHT_THRESHOLD) or (captDist.read() == 1)) thief = true; if (thief) triggerAlarm(); } else { std::cout << "Deactivated!" << std::endl; setDefault(); (button.getState()) ? door.open() : door.close(); } }
void MoverGroup::handleMateFiredWeapon (unsigned long mateWID) { triggerAlarm(PILOT_ALARM_MATE_FIRED_WEAPON, mateWID); }
long MoverGroup::handleMateDestroyed (unsigned long mateWID) { triggerAlarm(PILOT_ALARM_DEATH_OF_MATE, mateWID); return(NO_ERR); }
long MoverGroup::handleMateCrippled (unsigned long mateWID) { triggerAlarm(PILOT_ALARM_FRIENDLY_VEHICLE_CRIPPLED, mateWID); return(NO_ERR); }
int32_t MoverGroup::handleMateDestroyed(uint32_t mateWID) { triggerAlarm(PILOT_ALARM_DEATH_OF_MATE, mateWID); return (NO_ERROR); }
int32_t MoverGroup::handleMateCrippled(uint32_t mateWID) { triggerAlarm(PILOT_ALARM_FRIENDLY_VEHICLE_CRIPPLED, mateWID); return (NO_ERROR); }