38 #include <px4_platform_common/defines.h> 39 #include <px4_platform_common/px4_config.h> 86 vcmd.command = vehicle_command_s::VEHICLE_CMD_ARM_AUTHORIZATION_REQUEST;
87 vcmd.target_system =
arm_parameters.struct_value.authorizer_system_id;
90 vcmd_pub.publish(vcmd);
101 return vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED;
104 return vehicle_command_ack_s::VEHICLE_RESULT_DENIED;
138 vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED : vehicle_command_ack_s::VEHICLE_RESULT_DENIED;
149 return vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED;
153 return vehicle_command_ack_s::VEHICLE_RESULT_TEMPORARILY_REJECTED;
156 return vehicle_command_ack_s::VEHICLE_RESULT_DENIED;
168 return vehicle_command_ack_s::VEHICLE_RESULT_TEMPORARILY_REJECTED;
177 return vehicle_command_ack_s::VEHICLE_RESULT_DENIED;
208 bool updated =
false;
217 && command_ack.
command == vehicle_command_s::VEHICLE_CMD_ARM_AUTHORIZATION_REQUEST
219 switch (command_ack.
result) {
220 case vehicle_command_ack_s::VEHICLE_RESULT_IN_PROGRESS:
224 case vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED:
226 "Arm auth: Authorized for the next %u seconds",
232 case vehicle_command_ack_s::VEHICLE_RESULT_TEMPORARILY_REJECTED:
237 case vehicle_command_ack_s::VEHICLE_RESULT_DENIED:
240 case vehicle_command_ack_s::ARM_AUTH_DENIED_REASON_NONE:
244 case vehicle_command_ack_s::ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT:
248 case vehicle_command_ack_s::ARM_AUTH_DENIED_REASON_TIMEOUT:
252 case vehicle_command_ack_s::ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE:
256 case vehicle_command_ack_s::ARM_AUTH_DENIED_REASON_BAD_WEATHER:
260 case vehicle_command_ack_s::ARM_AUTH_DENIED_REASON_GENERIC:
static orb_advert_t * mavlink_log_pub
#define mavlink_log_critical(_pub, _text,...)
Send a mavlink critical message and print to console.
int orb_copy(const struct orb_metadata *meta, int handle, void *buffer)
static param_t param_arm_parameters
__EXPORT int param_get(param_t param, void *val)
Copy the value of a parameter.
static hrt_abstime auth_timeout
void arm_auth_update(hrt_abstime now, bool param_update)
static uint8_t(* arm_check_method[ARM_AUTH_METHOD_LAST])()
Global flash based parameter store.
int orb_subscribe(const struct orb_metadata *meta)
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
uint16_t auth_method_arm_timeout_msec
static uint8_t _auth_method_arm_req_check()
union @75::@76::@77 auth_method_param
static void arm_auth_request_msg_send()
struct __attribute__((__packed__)) reading_msg
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
uint8_t authentication_method
__EXPORT param_t param_find(const char *name)
Look up a parameter by name.
void arm_auth_init(orb_advert_t *mav_log_pub, uint8_t *sys_id)
int orb_check(int handle, bool *updated)
static int command_ack_sub
static uint8_t * system_id
enum arm_auth_methods arm_auth_method_get()
uint8_t authorizer_system_id
uint16_t auth_method_two_arm_timeout_msec
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
uint32_t param_t
Parameter handle.
static uint8_t _auth_method_two_arm_check()