mavsdk::ArmAuthorizerServer Class Reference ​
#include: arm_authorizer_server.h
Use arm authorization.
Public Types ​
Type | Description |
---|---|
enum RejectionReason | The rejection reason. |
enum Result | The result. |
std::function< void(Result)> ResultCallback | Callback type for asynchronous ArmAuthorizerServer calls. |
std::function< void(uint32_t)> ArmAuthorizationCallback | Callback type for subscribe_arm_authorization. |
Handle< uint32_t > ArmAuthorizationHandle | Handle type for subscribe_arm_authorization. |
Public Member Functions ​
Type | Name | Description |
---|---|---|
 | ArmAuthorizerServer (std::shared_ptr< ServerComponent > server_component) | Constructor. Creates the plugin for a ServerComponent instance. |
 | ~ArmAuthorizerServer () override | Destructor (internal use only). |
 | ArmAuthorizerServer (const ArmAuthorizerServer & other) | Copy constructor. |
ArmAuthorizationHandle | subscribe_arm_authorization (const ArmAuthorizationCallback & callback) | Subscribe to arm authorization request messages. Each request received should respond to using RespondArmAuthorization. |
void | unsubscribe_arm_authorization (ArmAuthorizationHandle handle) | Unsubscribe from subscribe_arm_authorization. |
Result | accept_arm_authorization (int32_t valid_time_s)const | Authorize arm for the specific time. |
Result | reject_arm_authorization (bool temporarily, RejectionReason reason, int32_t extra_info)const | Reject arm authorization request. |
const ArmAuthorizerServer & | operator= (const ArmAuthorizerServer &)=delete | Equality operator (object is not copyable). |
Constructor & Destructor Documentation ​
ArmAuthorizerServer() ​
mavsdk::ArmAuthorizerServer::ArmAuthorizerServer(std::shared_ptr< ServerComponent > server_component)
Constructor. Creates the plugin for a ServerComponent instance.
The plugin is typically created as shown below:
auto arm_authorizer_server = ArmAuthorizerServer(server_component);
Parameters
- std::shared_ptr< ServerComponent > server_component - The ServerComponent instance associated with this server plugin.
~ArmAuthorizerServer() ​
mavsdk::ArmAuthorizerServer::~ArmAuthorizerServer() override
Destructor (internal use only).
ArmAuthorizerServer() ​
mavsdk::ArmAuthorizerServer::ArmAuthorizerServer(const ArmAuthorizerServer &other)
Copy constructor.
Parameters
- const ArmAuthorizerServer& other -
Member Typdef Documentation ​
typedef ResultCallback ​
using mavsdk::ArmAuthorizerServer::ResultCallback = std::function<void(Result)>
Callback type for asynchronous ArmAuthorizerServer calls.
typedef ArmAuthorizationCallback ​
using mavsdk::ArmAuthorizerServer::ArmAuthorizationCallback = std::function<void(uint32_t)>
Callback type for subscribe_arm_authorization.
typedef ArmAuthorizationHandle ​
using mavsdk::ArmAuthorizerServer::ArmAuthorizationHandle = Handle<uint32_t>
Handle type for subscribe_arm_authorization.
Member Enumeration Documentation ​
enum RejectionReason ​
The rejection reason.
Value | Description |
---|---|
Generic | Not a specific reason. |
None | Authorizer will send the error as string to GCS. |
InvalidWaypoint | At least one waypoint have a invalid value. |
Timeout | Timeout in the authorizer process(in case it depends on network). |
AirspaceInUse | Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied.. |
BadWeather | Weather is not good to fly. |
enum Result ​
The result.
Value | Description |
---|---|
Unknown | Unknown result. |
Success | Command accepted. |
Failed | Command failed. |
Member Function Documentation ​
subscribe_arm_authorization() ​
ArmAuthorizationHandle mavsdk::ArmAuthorizerServer::subscribe_arm_authorization(const ArmAuthorizationCallback &callback)
Subscribe to arm authorization request messages. Each request received should respond to using RespondArmAuthorization.
Parameters
- const ArmAuthorizationCallback& callback -
Returns
unsubscribe_arm_authorization() ​
void mavsdk::ArmAuthorizerServer::unsubscribe_arm_authorization(ArmAuthorizationHandle handle)
Unsubscribe from subscribe_arm_authorization.
Parameters
- ArmAuthorizationHandle handle -
accept_arm_authorization() ​
Result mavsdk::ArmAuthorizerServer::accept_arm_authorization(int32_t valid_time_s) const
Authorize arm for the specific time.
This function is blocking.
Parameters
- int32_t valid_time_s -
Returns
 Result - Result of request.
reject_arm_authorization() ​
Result mavsdk::ArmAuthorizerServer::reject_arm_authorization(bool temporarily, RejectionReason reason, int32_t extra_info) const
Reject arm authorization request.
This function is blocking.
Parameters
- bool temporarily -
- RejectionReason reason -
- int32_t extra_info -
Returns
 Result - Result of request.
operator=() ​
const ArmAuthorizerServer & mavsdk::ArmAuthorizerServer::operator=(const ArmAuthorizerServer &)=delete
Equality operator (object is not copyable).
Parameters
- const ArmAuthorizerServer& -
Returns
 const ArmAuthorizerServer & -