PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Contains a list of uORB subscriptions and maintains their update state. More...
#include <subscriber_handler.h>
Public Member Functions | |
void | subscribe () |
void | unsubscribe () |
void | check_for_updates () |
int | get_battery_status_sub () const |
int | get_cpuload_sub () const |
int | get_vehicle_command_sub () const |
int | get_vehicle_status_sub () const |
int | get_vehicle_status_flags_sub () const |
bool | battery_status_updated () const |
bool | cpuload_updated () const |
bool | vehicle_command_updated () const |
bool | vehicle_status_updated () const |
bool | vehicle_status_flags_updated () const |
Private Types | |
enum | StatusMask : uint32_t { StatusMask::VehicleCommand = (0x01 << 0), StatusMask::VehicleStatus = (0x01 << 1), StatusMask::VehicleStatusFlags = (0x01 << 2), StatusMask::BatteryStatus = (0x01 << 3), StatusMask::CpuLoad = (0x01 << 4) } |
Private Attributes | |
int | _battery_status_sub = -1 |
int | _cpuload_sub = -1 |
int | _vehicle_command_sub = -1 |
int | _vehicle_status_sub = -1 |
int | _vehicle_status_flags_sub = -1 |
uint32_t | _update_bitfield = 0 |
Contains a list of uORB subscriptions and maintains their update state.
Definition at line 18 of file subscriber_handler.h.
|
strongprivate |
Enumerator | |
---|---|
VehicleCommand | |
VehicleStatus | |
VehicleStatusFlags | |
BatteryStatus | |
CpuLoad |
Definition at line 40 of file subscriber_handler.h.
|
inline |
Definition at line 32 of file subscriber_handler.h.
References _update_bitfield, and BatteryStatus.
Referenced by events::status::StatusDisplay::check_for_updates().
void events::SubscriberHandler::check_for_updates | ( | ) |
Definition at line 62 of file subscriber_handler.cpp.
References _battery_status_sub, _cpuload_sub, _update_bitfield, _vehicle_command_sub, _vehicle_status_flags_sub, _vehicle_status_sub, BatteryStatus, CpuLoad, orb_check(), VehicleCommand, VehicleStatus, and VehicleStatusFlags.
Referenced by events::SendEvent::cycle().
|
inline |
Definition at line 33 of file subscriber_handler.h.
References _update_bitfield, and CpuLoad.
Referenced by events::status::StatusDisplay::check_for_updates().
|
inline |
Definition at line 25 of file subscriber_handler.h.
References _battery_status_sub.
Referenced by events::status::StatusDisplay::check_for_updates().
|
inline |
Definition at line 26 of file subscriber_handler.h.
References _cpuload_sub.
Referenced by events::status::StatusDisplay::check_for_updates().
|
inline |
Definition at line 27 of file subscriber_handler.h.
References _vehicle_command_sub.
Referenced by events::SendEvent::process_commands().
|
inline |
Definition at line 29 of file subscriber_handler.h.
References _vehicle_status_flags_sub.
Referenced by events::status::StatusDisplay::check_for_updates().
|
inline |
Definition at line 28 of file subscriber_handler.h.
References _vehicle_status_sub.
Referenced by events::rc_loss::RC_Loss_Alarm::check_for_updates(), and events::status::StatusDisplay::check_for_updates().
void events::SubscriberHandler::subscribe | ( | ) |
Definition at line 9 of file subscriber_handler.cpp.
References _battery_status_sub, _cpuload_sub, _vehicle_command_sub, _vehicle_status_flags_sub, _vehicle_status_sub, cpuload, ORB_ID, and orb_subscribe().
Referenced by events::SendEvent::start().
void events::SubscriberHandler::unsubscribe | ( | ) |
Definition at line 33 of file subscriber_handler.cpp.
References _battery_status_sub, _cpuload_sub, _vehicle_command_sub, _vehicle_status_flags_sub, _vehicle_status_sub, and orb_unsubscribe().
Referenced by events::SendEvent::cycle().
|
inline |
Definition at line 34 of file subscriber_handler.h.
References _update_bitfield, and VehicleCommand.
Referenced by events::SendEvent::process_commands().
|
inline |
Definition at line 36 of file subscriber_handler.h.
References _update_bitfield, and VehicleStatusFlags.
Referenced by events::status::StatusDisplay::check_for_updates().
|
inline |
Definition at line 35 of file subscriber_handler.h.
References _update_bitfield, and VehicleStatus.
Referenced by events::rc_loss::RC_Loss_Alarm::check_for_updates(), and events::status::StatusDisplay::check_for_updates().
|
private |
Definition at line 48 of file subscriber_handler.h.
Referenced by check_for_updates(), get_battery_status_sub(), subscribe(), and unsubscribe().
|
private |
Definition at line 49 of file subscriber_handler.h.
Referenced by check_for_updates(), get_cpuload_sub(), subscribe(), and unsubscribe().
|
private |
Definition at line 54 of file subscriber_handler.h.
Referenced by battery_status_updated(), check_for_updates(), cpuload_updated(), vehicle_command_updated(), vehicle_status_flags_updated(), and vehicle_status_updated().
|
private |
Definition at line 50 of file subscriber_handler.h.
Referenced by check_for_updates(), get_vehicle_command_sub(), subscribe(), and unsubscribe().
|
private |
Definition at line 52 of file subscriber_handler.h.
Referenced by check_for_updates(), get_vehicle_status_flags_sub(), subscribe(), and unsubscribe().
|
private |
Definition at line 51 of file subscriber_handler.h.
Referenced by check_for_updates(), get_vehicle_status_sub(), subscribe(), and unsubscribe().