PX4 Firmware
PX4 Autopilot Software http://px4.io
uORB::SubscriptionCallbackWorkItem Class Reference

#include <SubscriptionCallback.hpp>

Inheritance diagram for uORB::SubscriptionCallbackWorkItem:
Collaboration diagram for uORB::SubscriptionCallbackWorkItem:

Public Member Functions

 SubscriptionCallbackWorkItem (px4::WorkItem *work_item, const orb_metadata *meta, uint8_t instance=0)
 Constructor. More...
 
virtual ~SubscriptionCallbackWorkItem ()=default
 
void call () override
 
- Public Member Functions inherited from uORB::SubscriptionCallback
 SubscriptionCallback (const orb_metadata *meta, uint8_t interval_ms=0, uint8_t instance=0)
 Constructor. More...
 
virtual ~SubscriptionCallback ()
 
bool registerCallback ()
 
void unregisterCallback ()
 
- 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
 

Private Attributes

px4::WorkItem * _work_item
 

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 107 of file SubscriptionCallback.hpp.

Constructor & Destructor Documentation

◆ SubscriptionCallbackWorkItem()

uORB::SubscriptionCallbackWorkItem::SubscriptionCallbackWorkItem ( px4::WorkItem *  work_item,
const orb_metadata meta,
uint8_t  instance = 0 
)
inline

Constructor.

Parameters
work_itemThe WorkItem that will be scheduled immediately on new publications.
metaThe uORB metadata (usually from the ORB_ID() macro) for the topic.
instanceThe instance for multi sub.

Definition at line 117 of file SubscriptionCallback.hpp.

◆ ~SubscriptionCallbackWorkItem()

virtual uORB::SubscriptionCallbackWorkItem::~SubscriptionCallbackWorkItem ( )
virtualdefault

Member Function Documentation

◆ call()

void uORB::SubscriptionCallbackWorkItem::call ( )
inlineoverridevirtual

Implements uORB::SubscriptionCallback.

Definition at line 125 of file SubscriptionCallback.hpp.

References uORB::SubscriptionInterval::_interval_us, uORB::SubscriptionInterval::_last_update, and hrt_elapsed_time_atomic().

Here is the call graph for this function:

Member Data Documentation

◆ _work_item

px4::WorkItem* uORB::SubscriptionCallbackWorkItem::_work_item
private

Definition at line 134 of file SubscriptionCallback.hpp.


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