mavsdk::ServerUtility Class Reference
#include: server_utility.h
Utility for onboard MAVSDK instances for common "server" tasks.
Public Types
Type | Description |
---|---|
enum StatusTextType | Status types. |
enum Result | Possible results returned for server utility requests. |
std::function< void(Result)> ResultCallback | Callback type for asynchronous ServerUtility calls. |
Public Member Functions
Type | Name | Description |
---|---|---|
ServerUtility (System & system) | Constructor. Creates the plugin for a specific System. | |
ServerUtility (std::shared_ptr< System > system) | Constructor. Creates the plugin for a specific System. | |
~ServerUtility () override | Destructor (internal use only). | |
ServerUtility (const ServerUtility & other) | Copy constructor. | |
Result | send_status_text (StatusTextType type, std::string text)const | Sends a statustext. |
const ServerUtility & | operator= (const ServerUtility &)=delete | Equality operator (object is not copyable). |
Constructor & Destructor Documentation
ServerUtility()
mavsdk::ServerUtility::ServerUtility(System &system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto server_utility = ServerUtility(system);
Parameters
- System& system - The specific system associated with this plugin.
ServerUtility()
mavsdk::ServerUtility::ServerUtility(std::shared_ptr< System > system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto server_utility = ServerUtility(system);
Parameters
- std::shared_ptr< System > system - The specific system associated with this plugin.
~ServerUtility()
mavsdk::ServerUtility::~ServerUtility() override
Destructor (internal use only).
ServerUtility()
mavsdk::ServerUtility::ServerUtility(const ServerUtility &other)
Copy constructor.
Parameters
- const ServerUtility& other -
Member Typdef Documentation
typedef ResultCallback
using mavsdk::ServerUtility::ResultCallback = std::function<void(Result)>
Callback type for asynchronous ServerUtility calls.
Member Enumeration Documentation
enum StatusTextType
Status types.
Value | Description |
---|---|
Debug |
Debug. |
Info |
Information. |
Notice |
Notice. |
Warning |
Warning. |
Error |
Error. |
Critical |
Critical. |
Alert |
Alert. |
Emergency |
Emergency. |
enum Result
Possible results returned for server utility requests.
Value | Description |
---|---|
Unknown |
Unknown result. |
Success |
Request succeeded. |
NoSystem |
No system is connected. |
ConnectionError |
Connection error. |
InvalidArgument |
Invalid argument. |
Member Function Documentation
send_status_text()
Result mavsdk::ServerUtility::send_status_text(StatusTextType type, std::string text) const
Sends a statustext.
This function is blocking.
Parameters
- StatusTextType type -
- std::string text -
Returns
Result - Result of request.
operator=()
const ServerUtility& mavsdk::ServerUtility::operator=(const ServerUtility &)=delete
Equality operator (object is not copyable).
Parameters
- const ServerUtility& -
Returns
const ServerUtility & -