PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <rc_loss_alarm.h>
Public Member Functions | |
RC_Loss_Alarm (const events::SubscriberHandler &subscriber_handler) | |
void | process () |
regularily called to handle state updates More... | |
Private Member Functions | |
bool | check_for_updates () |
check for topic updates More... | |
void | play_tune () |
Publish tune control to sound alarm. More... | |
void | stop_tune () |
Publish tune control to interrupt any sound. More... | |
Private Attributes | |
struct vehicle_status_s | _vehicle_status = {} |
bool | _was_armed = false |
bool | _had_rc = false |
bool | _alarm_playing = false |
orb_advert_t | _tune_control_pub = nullptr |
const events::SubscriberHandler & | _subscriber_handler |
Definition at line 52 of file rc_loss_alarm.h.
events::rc_loss::RC_Loss_Alarm::RC_Loss_Alarm | ( | const events::SubscriberHandler & | subscriber_handler | ) |
Definition at line 55 of file rc_loss_alarm.cpp.
|
private |
check for topic updates
Definition at line 60 of file rc_loss_alarm.cpp.
References _subscriber_handler, _vehicle_status, events::SubscriberHandler::get_vehicle_status_sub(), orb_copy(), ORB_ID, and events::SubscriberHandler::vehicle_status_updated().
Referenced by process().
|
private |
Publish tune control to sound alarm.
Definition at line 98 of file rc_loss_alarm.cpp.
References _tune_control_pub, hrt_absolute_time(), orb_advertise_queue(), ORB_ID, orb_publish(), tune_control_s::timestamp, tune_control_s::tune_id, tune_control_s::tune_override, and tune_control_s::volume.
Referenced by process().
void events::rc_loss::RC_Loss_Alarm::process | ( | ) |
regularily called to handle state updates
Definition at line 70 of file rc_loss_alarm.cpp.
References _alarm_playing, _had_rc, _vehicle_status, _was_armed, vehicle_status_s::arming_state, check_for_updates(), play_tune(), vehicle_status_s::rc_signal_lost, and stop_tune().
Referenced by events::SendEvent::cycle().
|
private |
Publish tune control to interrupt any sound.
Definition at line 114 of file rc_loss_alarm.cpp.
References _tune_control_pub, hrt_absolute_time(), orb_advertise_queue(), ORB_ID, orb_publish(), tune_control_s::timestamp, and tune_control_s::tune_override.
Referenced by process().
|
private |
Definition at line 77 of file rc_loss_alarm.h.
Referenced by process().
|
private |
Definition at line 76 of file rc_loss_alarm.h.
Referenced by process().
|
private |
Definition at line 79 of file rc_loss_alarm.h.
Referenced by check_for_updates().
|
private |
Definition at line 78 of file rc_loss_alarm.h.
Referenced by play_tune(), and stop_tune().
|
private |
Definition at line 74 of file rc_loss_alarm.h.
Referenced by check_for_updates(), and process().
|
private |
Definition at line 75 of file rc_loss_alarm.h.
Referenced by process().