PX4 Firmware
PX4 Autopilot Software http://px4.io
events::SubscriberHandler Class Reference

Contains a list of uORB subscriptions and maintains their update state. More...

#include <subscriber_handler.h>

Collaboration diagram for events::SubscriberHandler:

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
 

Detailed Description

Contains a list of uORB subscriptions and maintains their update state.

Definition at line 18 of file subscriber_handler.h.

Member Enumeration Documentation

◆ StatusMask

enum events::SubscriberHandler::StatusMask : uint32_t
strongprivate
Enumerator
VehicleCommand 
VehicleStatus 
VehicleStatusFlags 
BatteryStatus 
CpuLoad 

Definition at line 40 of file subscriber_handler.h.

Member Function Documentation

◆ battery_status_updated()

bool events::SubscriberHandler::battery_status_updated ( ) const
inline

Definition at line 32 of file subscriber_handler.h.

References _update_bitfield, and BatteryStatus.

Referenced by events::status::StatusDisplay::check_for_updates().

Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cpuload_updated()

bool events::SubscriberHandler::cpuload_updated ( ) const
inline

Definition at line 33 of file subscriber_handler.h.

References _update_bitfield, and CpuLoad.

Referenced by events::status::StatusDisplay::check_for_updates().

Here is the caller graph for this function:

◆ get_battery_status_sub()

int events::SubscriberHandler::get_battery_status_sub ( ) const
inline

Definition at line 25 of file subscriber_handler.h.

References _battery_status_sub.

Referenced by events::status::StatusDisplay::check_for_updates().

Here is the caller graph for this function:

◆ get_cpuload_sub()

int events::SubscriberHandler::get_cpuload_sub ( ) const
inline

Definition at line 26 of file subscriber_handler.h.

References _cpuload_sub.

Referenced by events::status::StatusDisplay::check_for_updates().

Here is the caller graph for this function:

◆ get_vehicle_command_sub()

int events::SubscriberHandler::get_vehicle_command_sub ( ) const
inline

Definition at line 27 of file subscriber_handler.h.

References _vehicle_command_sub.

Referenced by events::SendEvent::process_commands().

Here is the caller graph for this function:

◆ get_vehicle_status_flags_sub()

int events::SubscriberHandler::get_vehicle_status_flags_sub ( ) const
inline

Definition at line 29 of file subscriber_handler.h.

References _vehicle_status_flags_sub.

Referenced by events::status::StatusDisplay::check_for_updates().

Here is the caller graph for this function:

◆ get_vehicle_status_sub()

int events::SubscriberHandler::get_vehicle_status_sub ( ) const
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().

Here is the caller graph for this function:

◆ subscribe()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unsubscribe()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vehicle_command_updated()

bool events::SubscriberHandler::vehicle_command_updated ( ) const
inline

Definition at line 34 of file subscriber_handler.h.

References _update_bitfield, and VehicleCommand.

Referenced by events::SendEvent::process_commands().

Here is the caller graph for this function:

◆ vehicle_status_flags_updated()

bool events::SubscriberHandler::vehicle_status_flags_updated ( ) const
inline

Definition at line 36 of file subscriber_handler.h.

References _update_bitfield, and VehicleStatusFlags.

Referenced by events::status::StatusDisplay::check_for_updates().

Here is the caller graph for this function:

◆ vehicle_status_updated()

bool events::SubscriberHandler::vehicle_status_updated ( ) const
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().

Here is the caller graph for this function:

Member Data Documentation

◆ _battery_status_sub

int events::SubscriberHandler::_battery_status_sub = -1
private

◆ _cpuload_sub

int events::SubscriberHandler::_cpuload_sub = -1
private

Definition at line 49 of file subscriber_handler.h.

Referenced by check_for_updates(), get_cpuload_sub(), subscribe(), and unsubscribe().

◆ _update_bitfield

uint32_t events::SubscriberHandler::_update_bitfield = 0
private

◆ _vehicle_command_sub

int events::SubscriberHandler::_vehicle_command_sub = -1
private

◆ _vehicle_status_flags_sub

int events::SubscriberHandler::_vehicle_status_flags_sub = -1
private

◆ _vehicle_status_sub

int events::SubscriberHandler::_vehicle_status_sub = -1
private

The documentation for this class was generated from the following files: