PX4 Firmware
PX4 Autopilot Software http://px4.io
uORB::SubscriptionCallback Class Referenceabstract

#include <SubscriptionCallback.hpp>

Inheritance diagram for uORB::SubscriptionCallback:
Collaboration diagram for uORB::SubscriptionCallback:

Public Member Functions

 SubscriptionCallback (const orb_metadata *meta, uint8_t interval_ms=0, uint8_t instance=0)
 Constructor. More...
 
virtual ~SubscriptionCallback ()
 
bool registerCallback ()
 
void unregisterCallback ()
 
virtual void call ()=0
 
- Public Member Functions inherited from uORB::SubscriptionInterval
 SubscriptionInterval (const orb_metadata *meta, uint32_t interval_us=0, uint8_t instance=0)
 Constructor. More...
 
 SubscriptionInterval ()
 
 ~SubscriptionInterval ()=default
 
bool subscribe ()
 
bool advertised ()
 
bool updated ()
 Check if there is a new update. More...
 
bool update (void *dst)
 Copy the struct if updated. More...
 
bool copy (void *dst)
 Copy the struct. More...
 
bool valid () const
 
uint8_t get_instance () const
 
orb_id_t get_topic () const
 
void set_interval_us (uint32_t interval)
 Set the interval in microseconds. More...
 
void set_interval_ms (uint32_t interval)
 Set the interval in milliseconds. More...
 
- Public Member Functions inherited from ListNode< SubscriptionCallback *>
void setSibling (SubscriptionCallback * sibling)
 
const SubscriptionCallback * getSibling () const
 

Additional Inherited Members

- Protected Attributes inherited from uORB::SubscriptionInterval
Subscription _subscription
 
uint64_t _last_update {0}
 
uint32_t _interval_us {0}
 
- Protected Attributes inherited from ListNode< SubscriptionCallback *>
SubscriptionCallback * _list_node_sibling
 

Detailed Description

Definition at line 49 of file SubscriptionCallback.hpp.

Constructor & Destructor Documentation

◆ SubscriptionCallback()

uORB::SubscriptionCallback::SubscriptionCallback ( const orb_metadata meta,
uint8_t  interval_ms = 0,
uint8_t  instance = 0 
)
inline

Constructor.

Parameters
metaThe uORB metadata (usually from the ORB_ID() macro) for the topic.
interval_msThe requested maximum update interval in milliseconds.
instanceThe instance for multi sub.

Definition at line 59 of file SubscriptionCallback.hpp.

◆ ~SubscriptionCallback()

virtual uORB::SubscriptionCallback::~SubscriptionCallback ( )
inlinevirtual

Definition at line 64 of file SubscriptionCallback.hpp.

References unregisterCallback().

Here is the call graph for this function:

Member Function Documentation

◆ call()

virtual void uORB::SubscriptionCallback::call ( )
pure virtual

Implemented in uORB::SubscriptionCallbackWorkItem.

Referenced by unregisterCallback().

Here is the caller graph for this function:

◆ registerCallback()

bool uORB::SubscriptionCallback::registerCallback ( )
inline

◆ unregisterCallback()

void uORB::SubscriptionCallback::unregisterCallback ( )
inline

Definition at line 95 of file SubscriptionCallback.hpp.

References uORB::SubscriptionInterval::_subscription, call(), uORB::Subscription::get_node(), and uORB::DeviceNode::unregister_callback().

Referenced by MulticopterRateControl::Run(), MulticopterAttitudeControl::Run(), AttitudeEstimatorQ::Run(), FixedwingAttitudeControl::Run(), MulticopterPositionControl::Run(), VtolAttitudeControl::Run(), Ekf2::Run(), FixedwingPositionControl::Run(), BlockLocalPositionEstimator::Run(), VehicleAcceleration::Stop(), VehicleAngularVelocity::Stop(), and ~SubscriptionCallback().

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

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