PX4 Firmware
PX4 Autopilot Software http://px4.io
ArmAuthorization.cpp File Reference
#include "ArmAuthorization.h"
#include <string.h>
#include <unistd.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/px4_config.h>
#include <lib/parameters/param.h>
#include <systemlib/mavlink_log.h>
#include <uORB/PublicationQueued.hpp>
#include <uORB/topics/vehicle_command.h>
#include <uORB/topics/vehicle_command_ack.h>
Include dependency graph for ArmAuthorization.cpp:

Go to the source code of this file.

Enumerations

enum  { ARM_AUTH_IDLE = 0, ARM_AUTH_WAITING_AUTH, ARM_AUTH_WAITING_AUTH_WITH_ACK, ARM_AUTH_MISSION_APPROVED }
 

Functions

static uint8_t _auth_method_arm_req_check ()
 
static uint8_t _auth_method_two_arm_check ()
 
static void arm_auth_request_msg_send ()
 
uint8_t arm_auth_check ()
 
void arm_auth_update (hrt_abstime now, bool param_update)
 
void arm_auth_init (orb_advert_t *mav_log_pub, uint8_t *sys_id)
 
enum arm_auth_methods arm_auth_method_get ()
 

Variables

static orb_advert_tmavlink_log_pub
 
static int command_ack_sub = -1
 
static param_t param_arm_parameters
 
static hrt_abstime auth_timeout
 
static enum { ... }  state = ARM_AUTH_IDLE
 
union {
   int32_t   param_value
 
arm_parameters
 
static uint8_t * system_id
 
static uint8_t(* arm_check_method [ARM_AUTH_METHOD_LAST])()
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ARM_AUTH_IDLE 
ARM_AUTH_WAITING_AUTH 
ARM_AUTH_WAITING_AUTH_WITH_ACK 
ARM_AUTH_MISSION_APPROVED 

Definition at line 53 of file ArmAuthorization.cpp.

Function Documentation

◆ _auth_method_arm_req_check()

static uint8_t _auth_method_arm_req_check ( )
static

Definition at line 93 of file ArmAuthorization.cpp.

References ARM_AUTH_IDLE, ARM_AUTH_MISSION_APPROVED, arm_auth_request_msg_send(), arm_auth_update(), ARM_AUTH_WAITING_AUTH, ARM_AUTH_WAITING_AUTH_WITH_ACK, arm_parameters, auth_timeout, hrt_absolute_time(), hrt_abstime, mavlink_log_critical, mavlink_log_pub, and state.

Here is the call graph for this function:

◆ _auth_method_two_arm_check()

static uint8_t _auth_method_two_arm_check ( )
static

Definition at line 141 of file ArmAuthorization.cpp.

References ARM_AUTH_IDLE, ARM_AUTH_MISSION_APPROVED, arm_auth_request_msg_send(), ARM_AUTH_WAITING_AUTH, ARM_AUTH_WAITING_AUTH_WITH_ACK, arm_parameters, auth_timeout, hrt_absolute_time(), hrt_abstime, mavlink_log_critical, mavlink_log_pub, and state.

Here is the call graph for this function:

◆ arm_auth_check()

uint8_t arm_auth_check ( )

Definition at line 171 of file ArmAuthorization.cpp.

References ARM_AUTH_METHOD_LAST, arm_check_method, and arm_parameters.

Referenced by PreFlightCheck::preArmCheck().

Here is the caller graph for this function:

◆ arm_auth_init()

void arm_auth_init ( orb_advert_t mav_log_pub,
uint8_t *  sys_id 
)

Definition at line 276 of file ArmAuthorization.cpp.

References command_ack_sub, mavlink_log_pub, ORB_ID, orb_subscribe(), param_arm_parameters, and param_find().

Referenced by Commander::run().

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

◆ arm_auth_method_get()

enum arm_auth_methods arm_auth_method_get ( )

Definition at line 284 of file ArmAuthorization.cpp.

References arm_parameters.

◆ arm_auth_request_msg_send()

static void arm_auth_request_msg_send ( )
static

Definition at line 82 of file ArmAuthorization.cpp.

References arm_parameters, hrt_absolute_time(), ORB_ID, and vehicle_command_s::timestamp.

Referenced by _auth_method_arm_req_check(), and _auth_method_two_arm_check().

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

◆ arm_auth_update()

void arm_auth_update ( hrt_abstime  now,
bool  param_update 
)

Definition at line 180 of file ArmAuthorization.cpp.

References ARM_AUTH_IDLE, ARM_AUTH_MISSION_APPROVED, ARM_AUTH_WAITING_AUTH, ARM_AUTH_WAITING_AUTH_WITH_ACK, arm_parameters, auth_timeout, vehicle_command_ack_s::command, command_ack_sub, mavlink_log_critical, mavlink_log_pub, orb_check(), orb_copy(), ORB_ID, param_arm_parameters, param_get(), vehicle_command_ack_s::result, vehicle_command_ack_s::result_param1, vehicle_command_ack_s::result_param2, state, and vehicle_command_ack_s::target_system.

Referenced by _auth_method_arm_req_check(), and Commander::run().

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

Variable Documentation

◆ arm_check_method

uint8_t(* arm_check_method[ARM_AUTH_METHOD_LAST])()
static
Initial value:
= {
}
static uint8_t _auth_method_arm_req_check()
static uint8_t _auth_method_two_arm_check()

Definition at line 77 of file ArmAuthorization.cpp.

Referenced by arm_auth_check().

◆ arm_parameters

◆ auth_method_arm_timeout_msec

uint16_t auth_method_arm_timeout_msec

Definition at line 64 of file ArmAuthorization.cpp.

◆ auth_method_param

union { ... } auth_method_param

◆ auth_method_two_arm_timeout_msec

uint16_t auth_method_two_arm_timeout_msec

Definition at line 65 of file ArmAuthorization.cpp.

◆ auth_timeout

hrt_abstime auth_timeout
static

◆ authentication_method

uint8_t authentication_method

Definition at line 67 of file ArmAuthorization.cpp.

◆ authorizer_system_id

uint8_t authorizer_system_id

Definition at line 62 of file ArmAuthorization.cpp.

◆ command_ack_sub

int command_ack_sub = -1
static

Definition at line 47 of file ArmAuthorization.cpp.

Referenced by arm_auth_init(), and arm_auth_update().

◆ mavlink_log_pub

◆ param_arm_parameters

param_t param_arm_parameters
static

Definition at line 49 of file ArmAuthorization.cpp.

Referenced by arm_auth_init(), and arm_auth_update().

◆ param_value

◆ state

◆ system_id

uint8_t* system_id
static

Definition at line 72 of file ArmAuthorization.cpp.