mavsdk::Events Class Reference ​
#include: events.h
Get event notifications, such as takeoff, or arming checks.
Data Structures ​
struct Event
struct HealthAndArmingCheckMode
struct HealthAndArmingCheckProblem
struct HealthAndArmingCheckReport
struct HealthComponentReport
Public Types ​
| Type | Description |
|---|---|
| enum LogLevel | Log level type. |
| enum Result | Possible results returned. |
| std::function< void(Result)> ResultCallback | Callback type for asynchronous Events calls. |
| std::function< void(Event)> EventsCallback | Callback type for subscribe_events. |
| Handle< Event > EventsHandle | Handle type for subscribe_events. |
| std::function< void(HealthAndArmingCheckReport)> HealthAndArmingChecksCallback | Callback type for subscribe_health_and_arming_checks. |
| Handle< HealthAndArmingCheckReport > HealthAndArmingChecksHandle | Handle type for subscribe_health_and_arming_checks. |
Public Member Functions ​
| Type | Name | Description |
|---|---|---|
| Â | Events (System & system) | Constructor. Creates the plugin for a specific System. |
| Â | Events (std::shared_ptr< System > system) | Constructor. Creates the plugin for a specific System. |
| Â | ~Events () override | Destructor (internal use only). |
| Â | Events (const Events & other) | Copy constructor. |
| EventsHandle | subscribe_events (const EventsCallback & callback) | Subscribe to event updates. |
| void | unsubscribe_events (EventsHandle handle) | Unsubscribe from subscribe_events. |
| HealthAndArmingChecksHandle | subscribe_health_and_arming_checks (const HealthAndArmingChecksCallback & callback) | Subscribe to arming check updates. |
| void | unsubscribe_health_and_arming_checks (HealthAndArmingChecksHandle handle) | Unsubscribe from subscribe_health_and_arming_checks. |
| std::pair< Result, Events::HealthAndArmingCheckReport > | get_health_and_arming_checks_report () const | Get the latest report. |
| const Events & | operator= (const Events &)=delete | Equality operator (object is not copyable). |
Constructor & Destructor Documentation ​
Events() ​
mavsdk::Events::Events(System &system)Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto events = Events(system);Parameters
- System& system - The specific system associated with this plugin.
Events() ​
mavsdk::Events::Events(std::shared_ptr< System > system)Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto events = Events(system);Parameters
- std::shared_ptr< System > system - The specific system associated with this plugin.
~Events() ​
mavsdk::Events::~Events() overrideDestructor (internal use only).
Events() ​
mavsdk::Events::Events(const Events &other)Copy constructor.
Parameters
- const Events& other -
Member Typdef Documentation ​
typedef ResultCallback ​
using mavsdk::Events::ResultCallback = std::function<void(Result)>Callback type for asynchronous Events calls.
typedef EventsCallback ​
using mavsdk::Events::EventsCallback = std::function<void(Event)>Callback type for subscribe_events.
typedef EventsHandle ​
using mavsdk::Events::EventsHandle = Handle<Event>Handle type for subscribe_events.
typedef HealthAndArmingChecksCallback ​
using mavsdk::Events::HealthAndArmingChecksCallback = std::function<void(HealthAndArmingCheckReport)>Callback type for subscribe_health_and_arming_checks.
typedef HealthAndArmingChecksHandle ​
using mavsdk::Events::HealthAndArmingChecksHandle = Handle<HealthAndArmingCheckReport>Handle type for subscribe_health_and_arming_checks.
Member Enumeration Documentation ​
enum LogLevel ​
Log level type.
| Value | Description |
|---|---|
Emergency | Emergency. |
Alert | Alert. |
Critical | Critical. |
Error | Error. |
Warning | Warning. |
Notice | Notice. |
Info | Info. |
Debug | Debug. |
enum Result ​
Possible results returned.
| Value | Description |
|---|---|
Success | Successful result. |
NotAvailable | Not available. |
ConnectionError | Connection error. |
Unsupported | Unsupported. |
Denied | Denied. |
Failed | Failed. |
Timeout | Timeout. |
NoSystem | No system available. |
Unknown | Unknown result. |
Member Function Documentation ​
subscribe_events() ​
EventsHandle mavsdk::Events::subscribe_events(const EventsCallback &callback)Subscribe to event updates.
Parameters
- const EventsCallback& callback -
Returns
 EventsHandle -
unsubscribe_events() ​
void mavsdk::Events::unsubscribe_events(EventsHandle handle)Unsubscribe from subscribe_events.
Parameters
- EventsHandle handle -
subscribe_health_and_arming_checks() ​
HealthAndArmingChecksHandle mavsdk::Events::subscribe_health_and_arming_checks(const HealthAndArmingChecksCallback &callback)Subscribe to arming check updates.
Parameters
- const HealthAndArmingChecksCallback& callback -
Returns
 HealthAndArmingChecksHandle -
unsubscribe_health_and_arming_checks() ​
void mavsdk::Events::unsubscribe_health_and_arming_checks(HealthAndArmingChecksHandle handle)Unsubscribe from subscribe_health_and_arming_checks.
Parameters
- HealthAndArmingChecksHandle handle -
get_health_and_arming_checks_report() ​
std::pair< Result, Events::HealthAndArmingCheckReport > mavsdk::Events::get_health_and_arming_checks_report() constGet the latest report.
This function is blocking.
Returns
 std::pair< Result, Events::HealthAndArmingCheckReport > - Result of request.
operator=() ​
const Events & mavsdk::Events::operator=(const Events &)=deleteEquality operator (object is not copyable).
Parameters
- const Events& -
Returns
 const Events & -

