PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <mavlink_parameters.h>
Classes | |
struct | _uavcan_open_request_list_item |
Public Member Functions | |
MavlinkParametersManager (Mavlink *mavlink) | |
~MavlinkParametersManager ()=default | |
void | send (const hrt_abstime t) |
Handle sending of messages. More... | |
unsigned | get_size () |
void | handle_message (const mavlink_message_t *msg) |
Protected Member Functions | |
bool | send_one () |
send a single param if a PARAM_REQUEST_LIST is in progress More... | |
bool | send_params () |
Handle any open param send transfer. More... | |
bool | send_uavcan () |
Send UAVCAN params. More... | |
bool | send_untransmitted () |
Send untransmitted params. More... | |
int | send_param (param_t param, int component_id=-1) |
void | request_next_uavcan_parameter () |
Request the next uavcan parameter. More... | |
void | enque_uavcan_request (uavcan_parameter_request_s *req) |
Enqueue one uavcan parameter reqest. More... | |
void | dequeue_uavcan_request () |
Drop the first reqest from the list. More... | |
Protected Attributes | |
_uavcan_open_request_list_item * | _uavcan_open_request_list {nullptr} |
Pointer to the first item in the linked list. More... | |
bool | _uavcan_waiting_for_request_response {false} |
We have reqested a parameter and wait for the response. More... | |
uint16_t | _uavcan_queued_request_items {0} |
Number of stored parameter requests currently in the list. More... | |
uORB::Publication< rc_parameter_map_s > | _rc_param_map_pub {ORB_ID(rc_parameter_map)} |
rc_parameter_map_s | _rc_param_map {} |
uORB::PublicationQueued< uavcan_parameter_request_s > | _uavcan_parameter_request_pub {ORB_ID(uavcan_parameter_request)} |
uORB::Subscription | _uavcan_parameter_value_sub {ORB_ID(uavcan_parameter_value)} |
uORB::Subscription | _mavlink_parameter_sub {ORB_ID(parameter_update)} |
hrt_abstime | _param_update_time {0} |
int | _param_update_index {0} |
Mavlink * | _mavlink |
Private Member Functions | |
MavlinkParametersManager (MavlinkParametersManager &) | |
MavlinkParametersManager & | operator= (const MavlinkParametersManager &) |
Private Attributes | |
int | _send_all_index {-1} |
Definition at line 59 of file mavlink_parameters.h.
|
explicit |
Definition at line 48 of file mavlink_parameters.cpp.
|
default |
|
private |
|
protected |
Drop the first reqest from the list.
Definition at line 592 of file mavlink_parameters.cpp.
References _uavcan_open_request_list, _uavcan_queued_request_items, _uavcan_waiting_for_request_response, and MavlinkParametersManager::_uavcan_open_request_list_item::next.
Referenced by send_uavcan().
|
protected |
Enqueue one uavcan parameter reqest.
We store 10 at max.
Definition at line 563 of file mavlink_parameters.cpp.
References _uavcan_open_request_list, _uavcan_queued_request_items, MavlinkParametersManager::_uavcan_open_request_list_item::next, and MavlinkParametersManager::_uavcan_open_request_list_item::req.
Referenced by handle_message().
unsigned MavlinkParametersManager::get_size | ( | ) |
Definition at line 54 of file mavlink_parameters.cpp.
Referenced by send(), and send_untransmitted().
void MavlinkParametersManager::handle_message | ( | const mavlink_message_t * | msg | ) |
Definition at line 60 of file mavlink_parameters.cpp.
References _mavlink, _rc_param_map, _rc_param_map_pub, _send_all_index, _uavcan_parameter_request_pub, enque_uavcan_request(), Mavlink::get_channel(), Mavlink::hash_check_enabled(), HASH_PARAM, hrt_absolute_time(), uavcan_parameter_request_s::int_value, mavlink_system, uavcan_parameter_request_s::message_type, name, uavcan_parameter_request_s::node_id, param_count_used(), param_find_no_notification(), param_for_used_index(), PARAM_HASH, param_hash_check(), uavcan_parameter_request_s::param_id, rc_parameter_map_s::param_id, rc_parameter_map_s::param_index, uavcan_parameter_request_s::param_index, PARAM_INVALID, param_set(), uavcan_parameter_request_s::param_type, param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, param_value, uORB::Publication< T >::publish(), uORB::PublicationQueued< T >::publish(), uavcan_parameter_request_s::real_value, request_next_uavcan_parameter(), rc_parameter_map_s::scale, send_param(), Mavlink::send_statustext_info(), uavcan_parameter_request_s::timestamp, rc_parameter_map_s::timestamp, rc_parameter_map_s::valid, rc_parameter_map_s::value0, rc_parameter_map_s::value_max, and rc_parameter_map_s::value_min.
Referenced by MavlinkReceiver::Run().
|
private |
|
protected |
Request the next uavcan parameter.
Definition at line 551 of file mavlink_parameters.cpp.
References _uavcan_open_request_list, _uavcan_parameter_request_pub, _uavcan_waiting_for_request_response, uORB::PublicationQueued< T >::publish(), and MavlinkParametersManager::_uavcan_open_request_list_item::req.
Referenced by handle_message(), and send_uavcan().
void MavlinkParametersManager::send | ( | const hrt_abstime | t | ) |
Handle sending of messages.
Call this regularly at a fixed frequency.
t | current time |
Definition at line 277 of file mavlink_parameters.cpp.
References _mavlink, Mavlink::get_free_tx_buf(), Mavlink::get_protocol(), get_size(), Mavlink::is_usb_uart(), send_params(), and SERIAL.
Referenced by MavlinkReceiver::Run().
|
protected |
send a single param if a PARAM_REQUEST_LIST is in progress
Definition at line 422 of file mavlink_parameters.cpp.
References _mavlink, _send_all_index, Mavlink::get_channel(), HASH_PARAM, msg, param_count(), param_count_used(), param_for_index(), PARAM_HASH, param_hash_check(), PARAM_INVALID, param_used(), and send_param().
Referenced by send_params().
|
protected |
Definition at line 476 of file mavlink_parameters.cpp.
References _mavlink, Mavlink::get_channel(), Mavlink::get_free_tx_buf(), mavlink_system, msg, OK, param_count_used(), param_get(), param_get_used_index(), PARAM_INVALID, param_name(), param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, and param_value.
Referenced by handle_message(), send_one(), and send_untransmitted().
|
protected |
Handle any open param send transfer.
Definition at line 296 of file mavlink_parameters.cpp.
References send_one(), send_uavcan(), and send_untransmitted().
Referenced by send().
|
protected |
Send UAVCAN params.
Definition at line 365 of file mavlink_parameters.cpp.
References _mavlink, _uavcan_open_request_list, _uavcan_parameter_value_sub, dequeue_uavcan_request(), Mavlink::get_channel(), mavlink_system, msg, uavcan_parameter_request_s::node_id, uavcan_parameter_request_s::param_index, MavlinkParametersManager::_uavcan_open_request_list_item::req, request_next_uavcan_parameter(), and uORB::Subscription::update().
Referenced by send_params().
|
protected |
Send untransmitted params.
Definition at line 313 of file mavlink_parameters.cpp.
References _mavlink, _mavlink_parameter_sub, _param_update_index, _param_update_time, Mavlink::get_free_tx_buf(), get_size(), hrt_absolute_time(), param_count(), param_for_index(), PARAM_INVALID, param_name(), param_used(), param_value_unsaved(), send_param(), parameter_update_s::timestamp, uORB::Subscription::update(), and uORB::Subscription::updated().
Referenced by send_params().
|
protected |
Definition at line 140 of file mavlink_parameters.h.
Referenced by handle_message(), send(), send_one(), send_param(), send_uavcan(), and send_untransmitted().
|
protected |
Definition at line 136 of file mavlink_parameters.h.
Referenced by send_untransmitted().
|
protected |
Definition at line 138 of file mavlink_parameters.h.
Referenced by send_untransmitted().
|
protected |
Definition at line 137 of file mavlink_parameters.h.
Referenced by send_untransmitted().
|
protected |
Definition at line 130 of file mavlink_parameters.h.
Referenced by handle_message().
|
protected |
Definition at line 129 of file mavlink_parameters.h.
Referenced by handle_message().
|
private |
Definition at line 76 of file mavlink_parameters.h.
Referenced by handle_message(), and send_one().
|
protected |
Pointer to the first item in the linked list.
Definition at line 125 of file mavlink_parameters.h.
Referenced by dequeue_uavcan_request(), enque_uavcan_request(), request_next_uavcan_parameter(), and send_uavcan().
|
protected |
Definition at line 132 of file mavlink_parameters.h.
Referenced by handle_message(), and request_next_uavcan_parameter().
|
protected |
Definition at line 134 of file mavlink_parameters.h.
Referenced by send_uavcan().
|
protected |
Number of stored parameter requests currently in the list.
Definition at line 127 of file mavlink_parameters.h.
Referenced by dequeue_uavcan_request(), and enque_uavcan_request().
|
protected |
We have reqested a parameter and wait for the response.
Definition at line 126 of file mavlink_parameters.h.
Referenced by dequeue_uavcan_request(), and request_next_uavcan_parameter().