PX4 Firmware
PX4 Autopilot Software http://px4.io
|
A UAVCAN Server Sub node. More...
#include <uavcan_servers.hpp>
Public Member Functions | |
UavcanServers (uavcan::INode &main_node) | |
virtual | ~UavcanServers () |
uavcan::SubNode & | get_node () |
void | attachITxQueueInjector (ITxQueueInjector **injector) |
void | requestCheckAllNodesFirmwareAndUpdate () |
bool | guessIfAllDynamicNodesAreAllocated () |
Static Public Member Functions | |
static int | start (uavcan::INode &main_node) |
static int | stop () |
static UavcanServers * | instance () |
Private Types | |
typedef uavcan::MethodBinder< UavcanServers *, void(UavcanServers::*)(const uavcan::ServiceCallResult< uavcan::protocol::param::GetSet > &)> | GetSetCallback |
typedef uavcan::MethodBinder< UavcanServers *, void(UavcanServers::*)(const uavcan::ServiceCallResult< uavcan::protocol::param::ExecuteOpcode > &)> | ExecuteOpcodeCallback |
typedef uavcan::MethodBinder< UavcanServers *, void(UavcanServers::*)(const uavcan::ServiceCallResult< uavcan::protocol::RestartNode > &)> | RestartNodeCallback |
typedef uavcan::MethodBinder< UavcanServers *, void(UavcanServers::*)(const uavcan::ServiceCallResult< uavcan::protocol::enumeration::Begin > &)> | EnumerationBeginCallback |
typedef uavcan::MethodBinder< UavcanServers *, void(UavcanServers::*)(const uavcan::ReceivedDataStructure< uavcan::protocol::enumeration::Indication > &)> | EnumerationIndicationCallback |
Private Member Functions | |
int | init () |
pthread_addr_t | run (pthread_addr_t) |
void | cb_getset (const uavcan::ServiceCallResult< uavcan::protocol::param::GetSet > &result) |
void | cb_count (const uavcan::ServiceCallResult< uavcan::protocol::param::GetSet > &result) |
void | cb_opcode (const uavcan::ServiceCallResult< uavcan::protocol::param::ExecuteOpcode > &result) |
void | cb_restart (const uavcan::ServiceCallResult< uavcan::protocol::RestartNode > &result) |
void | param_count (uavcan::NodeID node_id) |
void | param_opcode (uavcan::NodeID node_id) |
uint8_t | get_next_active_node_id (uint8_t base) |
uint8_t | get_next_dirty_node_id (uint8_t base) |
void | set_node_params_dirty (uint8_t node_id) |
void | clear_node_params_dirty (uint8_t node_id) |
bool | are_node_params_dirty (uint8_t node_id) const |
void | beep (float frequency) |
void | cb_enumeration_begin (const uavcan::ServiceCallResult< uavcan::protocol::enumeration::Begin > &result) |
void | cb_enumeration_indication (const uavcan::ReceivedDataStructure< uavcan::protocol::enumeration::Indication > &msg) |
void | cb_enumeration_getset (const uavcan::ServiceCallResult< uavcan::protocol::param::GetSet > &result) |
void | cb_enumeration_save (const uavcan::ServiceCallResult< uavcan::protocol::param::ExecuteOpcode > &result) |
void | unpackFwFromROMFS (const char *sd_path, const char *romfs_path) |
int | copyFw (const char *dst, const char *src) |
Private Attributes | |
pthread_t | _subnode_thread {-1} |
pthread_mutex_t | _subnode_mutex {} |
volatile bool | _subnode_thread_should_exit {false} |
VirtualCanDriver | _vdriver |
uavcan::SubNode | _subnode |
uavcan::INode & | _main_node |
uavcan_posix::dynamic_node_id_server::FileEventTracer | _tracer |
uavcan_posix::dynamic_node_id_server::FileStorageBackend | _storage_backend |
uavcan_posix::FirmwareVersionChecker | _fw_version_checker |
uavcan::dynamic_node_id_server::CentralizedServer | _server_instance |
server singleton pointer More... | |
uavcan_posix::BasicFileServerBackend | _fileserver_backend |
uavcan::NodeInfoRetriever | _node_info_retriever |
uavcan::FirmwareUpdateTrigger | _fw_upgrade_trigger |
uavcan::BasicFileServer | _fw_server |
uint8_t | _param_counts [128] = {} |
bool | _count_in_progress = false |
uint8_t | _count_index = 0 |
bool | _param_in_progress = false |
uint8_t | _param_index = 0 |
bool | _param_list_in_progress = false |
bool | _param_list_all_nodes = false |
uint8_t | _param_list_node_id = 1 |
uint32_t | _param_dirty_bitmap [4] = {} |
uint8_t | _param_save_opcode = 0 |
bool | _cmd_in_progress = false |
uORB::Publication< uavcan_parameter_value_s > | _param_response_pub {ORB_ID(uavcan_parameter_value)} |
uORB::PublicationQueued< vehicle_command_ack_s > | _command_ack_pub {ORB_ID(vehicle_command_ack)} |
uavcan::ServiceClient< uavcan::protocol::param::GetSet, GetSetCallback > | _param_getset_client |
uavcan::ServiceClient< uavcan::protocol::param::ExecuteOpcode, ExecuteOpcodeCallback > | _param_opcode_client |
uavcan::ServiceClient< uavcan::protocol::RestartNode, RestartNodeCallback > | _param_restartnode_client |
bool | _mutex_inited = false |
volatile bool | _check_fw = false |
bool | _esc_enumeration_active = false |
uint8_t | _esc_enumeration_ids [uavcan::equipment::esc::RawCommand::FieldTypes::cmd::MaxSize] |
uint8_t | _esc_enumeration_index = 0 |
uint8_t | _esc_count = 0 |
uavcan::Publisher< uavcan::equipment::indication::BeepCommand > | _beep_pub |
uavcan::Subscriber< uavcan::protocol::enumeration::Indication, EnumerationIndicationCallback > | _enumeration_indication_sub |
uavcan::ServiceClient< uavcan::protocol::enumeration::Begin, EnumerationBeginCallback > | _enumeration_client |
uavcan::ServiceClient< uavcan::protocol::param::GetSet, GetSetCallback > | _enumeration_getset_client |
uavcan::ServiceClient< uavcan::protocol::param::ExecuteOpcode, ExecuteOpcodeCallback > | _enumeration_save_client |
Static Private Attributes | |
static constexpr unsigned | NumIfaces = 1 |
static constexpr unsigned | StackSize = 6000 |
static constexpr unsigned | Priority = 120 |
static constexpr unsigned | VirtualIfaceBlockAllocationQuota = 80 |
static constexpr float | BeepFrequencyGenericIndication = 1000.0F |
static constexpr float | BeepFrequencySuccess = 2000.0F |
static constexpr float | BeepFrequencyError = 100.0F |
static UavcanServers * | _instance |
singleton pointer More... | |
A UAVCAN Server Sub node.
Definition at line 78 of file uavcan_servers.hpp.
|
private |
Definition at line 207 of file uavcan_servers.hpp.
|
private |
Definition at line 210 of file uavcan_servers.hpp.
|
private |
Definition at line 173 of file uavcan_servers.hpp.
|
private |
Definition at line 170 of file uavcan_servers.hpp.
|
private |
Definition at line 175 of file uavcan_servers.hpp.
UavcanServers::UavcanServers | ( | uavcan::INode & | main_node | ) |
Definition at line 79 of file uavcan_servers.cpp.
Referenced by start().
|
virtual |
Definition at line 99 of file uavcan_servers.cpp.
References _main_node, _mutex_inited, _subnode_mutex, and Lock::deinit().
|
inlineprivate |
Definition at line 192 of file uavcan_servers.hpp.
Referenced by get_next_dirty_node_id().
|
inline |
Definition at line 108 of file uavcan_servers.hpp.
Referenced by UavcanNode::start_fw_server().
|
private |
Definition at line 798 of file uavcan_servers.cpp.
References _beep_pub.
Referenced by cb_enumeration_save(), cb_getset(), and run().
|
private |
|
private |
Definition at line 807 of file uavcan_servers.cpp.
References _enumeration_client, _esc_count, _esc_enumeration_active, and get_next_active_node_id().
Referenced by run().
|
private |
Definition at line 882 of file uavcan_servers.cpp.
References _enumeration_save_client, _esc_enumeration_ids, _esc_enumeration_index, math::max(), and math::min().
Referenced by run().
|
private |
Definition at line 846 of file uavcan_servers.cpp.
References _enumeration_getset_client, _esc_enumeration_active, _esc_enumeration_ids, and _esc_enumeration_index.
Referenced by run().
|
private |
Definition at line 912 of file uavcan_servers.cpp.
References _enumeration_client, _esc_count, _esc_enumeration_active, _esc_enumeration_index, beep(), BeepFrequencyError, BeepFrequencyGenericIndication, BeepFrequencySuccess, and get_next_active_node_id().
Referenced by run().
|
private |
Definition at line 586 of file uavcan_servers.cpp.
References _count_in_progress, _count_index, _param_counts, _param_getset_client, _param_in_progress, _param_index, _param_response_pub, beep(), BeepFrequencyError, BeepFrequencyGenericIndication, uavcan_parameter_value_s::int_value, uavcan_parameter_value_s::node_id, uavcan_parameter_value_s::param_count, uavcan_parameter_value_s::param_id, uavcan_parameter_value_s::param_index, uavcan_parameter_value_s::param_type, uORB::Publication< T >::publish(), and uavcan_parameter_value_s::real_value.
Referenced by run().
|
private |
Definition at line 704 of file uavcan_servers.cpp.
References _cmd_in_progress, _param_restartnode_client, get_next_dirty_node_id(), uavcan_parameter_value_s::node_id, and param_opcode().
Referenced by run().
|
private |
Definition at line 750 of file uavcan_servers.cpp.
References _cmd_in_progress, clear_node_params_dirty(), get_next_dirty_node_id(), uavcan_parameter_value_s::node_id, and param_opcode().
Referenced by run().
|
inlineprivate |
Definition at line 191 of file uavcan_servers.hpp.
Referenced by cb_restart().
|
private |
Definition at line 1210 of file uavcan_servers.cpp.
References read(), and write().
Referenced by unpackFwFromROMFS().
|
private |
Definition at line 777 of file uavcan_servers.cpp.
References _node_info_retriever, and _subnode.
Referenced by cb_enumeration_begin(), cb_enumeration_save(), and run().
|
private |
Definition at line 788 of file uavcan_servers.cpp.
References are_node_params_dirty().
Referenced by cb_opcode(), cb_restart(), and run().
|
inline |
Definition at line 99 of file uavcan_servers.hpp.
|
inline |
Definition at line 112 of file uavcan_servers.hpp.
Referenced by UavcanNode::ioctl().
|
private |
Definition at line 189 of file uavcan_servers.cpp.
References _fw_server, _fw_upgrade_trigger, _fw_version_checker, _main_node, _mutex_inited, _node_info_retriever, _server_instance, _storage_backend, _subnode, _subnode_mutex, _tracer, _vdriver, UavcanNode::getHardwareVersion(), Lock::init(), UAVCAN_FIRMWARE_PATH, UAVCAN_LOG_FILE, and UAVCAN_NODE_DB_PATH.
Referenced by start().
|
inlinestatic |
Definition at line 101 of file uavcan_servers.hpp.
Referenced by UavcanNode::ioctl(), UavcanNode::request_fw_check(), UavcanNode::start_fw_server(), stop(), UavcanNode::stop_fw_server(), and uavcan_main().
|
private |
Definition at line 671 of file uavcan_servers.cpp.
References _count_in_progress, _count_index, and _param_getset_client.
Referenced by run().
|
private |
Definition at line 688 of file uavcan_servers.cpp.
References _cmd_in_progress, _param_opcode_client, and _param_save_opcode.
Referenced by cb_opcode(), cb_restart(), and run().
|
inline |
Definition at line 110 of file uavcan_servers.hpp.
Referenced by UavcanNode::request_fw_check().
|
private |
Definition at line 280 of file uavcan_servers.cpp.
References _check_fw, _cmd_in_progress, _command_ack_pub, _count_in_progress, _enumeration_client, _enumeration_getset_client, _enumeration_indication_sub, _enumeration_save_client, _esc_count, _esc_enumeration_active, _esc_enumeration_ids, _esc_enumeration_index, _node_info_retriever, _param_counts, _param_getset_client, _param_in_progress, _param_index, _param_list_all_nodes, _param_list_in_progress, _param_list_node_id, _param_opcode_client, _param_restartnode_client, _param_save_opcode, _subnode, _subnode_mutex, _subnode_thread_should_exit, actuator_armed_s::armed, armed, beep(), BeepFrequencyError, BeepFrequencyGenericIndication, cb_enumeration_begin(), cb_enumeration_getset(), cb_enumeration_indication(), cb_enumeration_save(), cb_getset(), cb_opcode(), cb_restart(), get_next_active_node_id(), get_next_dirty_node_id(), hrt_absolute_time(), MicroBenchHRT::lock(), actuator_armed_s::lockdown, actuator_armed_s::manual_lockdown, ORB_ID, param_count(), uavcan_parameter_request_s::param_index, param_opcode(), uORB::PublicationQueued< T >::publish(), set_node_params_dirty(), vehicle_command_ack_s::timestamp, UAVCAN_FIRMWARE_PATH, UAVCAN_ROMFS_FW_PATH, and unpackFwFromROMFS().
Referenced by start().
|
inlineprivate |
Definition at line 190 of file uavcan_servers.hpp.
Referenced by run().
|
static |
Definition at line 133 of file uavcan_servers.cpp.
References _instance, _subnode_thread, init(), Priority, run(), StackSize, and UavcanServers().
Referenced by UavcanNode::start_fw_server().
|
static |
Definition at line 109 of file uavcan_servers.cpp.
References _instance, _main_node, _subnode_thread, _subnode_thread_should_exit, and instance().
Referenced by UavcanNode::stop_fw_server().
|
private |
Definition at line 955 of file uavcan_servers.cpp.
References copyFw(), UAVCAN_MAX_PATH_LENGTH, and UAVCAN_ROMFS_FW_PREFIX.
Referenced by run().
|
private |
Definition at line 216 of file uavcan_servers.hpp.
Referenced by beep().
|
private |
Definition at line 197 of file uavcan_servers.hpp.
Referenced by run().
|
private |
Definition at line 163 of file uavcan_servers.hpp.
Referenced by cb_opcode(), cb_restart(), param_opcode(), and run().
|
private |
Definition at line 167 of file uavcan_servers.hpp.
Referenced by run().
|
private |
Definition at line 151 of file uavcan_servers.hpp.
Referenced by cb_getset(), param_count(), and run().
|
private |
Definition at line 152 of file uavcan_servers.hpp.
Referenced by cb_getset(), and param_count().
|
private |
Definition at line 219 of file uavcan_servers.hpp.
Referenced by cb_enumeration_begin(), cb_enumeration_save(), and run().
|
private |
Definition at line 220 of file uavcan_servers.hpp.
Referenced by cb_enumeration_indication(), and run().
|
private |
Definition at line 218 of file uavcan_servers.hpp.
Referenced by run().
|
private |
Definition at line 221 of file uavcan_servers.hpp.
Referenced by cb_enumeration_getset(), and run().
|
private |
Definition at line 203 of file uavcan_servers.hpp.
Referenced by cb_enumeration_begin(), cb_enumeration_save(), and run().
|
private |
Definition at line 200 of file uavcan_servers.hpp.
Referenced by cb_enumeration_begin(), cb_enumeration_indication(), cb_enumeration_save(), and run().
|
private |
Definition at line 201 of file uavcan_servers.hpp.
Referenced by cb_enumeration_getset(), cb_enumeration_indication(), and run().
|
private |
Definition at line 202 of file uavcan_servers.hpp.
Referenced by cb_enumeration_getset(), cb_enumeration_indication(), cb_enumeration_save(), and run().
|
private |
Definition at line 134 of file uavcan_servers.hpp.
|
private |
Definition at line 137 of file uavcan_servers.hpp.
Referenced by init().
|
private |
Definition at line 136 of file uavcan_servers.hpp.
Referenced by init().
|
private |
Definition at line 132 of file uavcan_servers.hpp.
Referenced by init().
|
staticprivate |
singleton pointer
Definition at line 123 of file uavcan_servers.hpp.
|
private |
Definition at line 128 of file uavcan_servers.hpp.
Referenced by init(), stop(), and ~UavcanServers().
|
private |
Definition at line 196 of file uavcan_servers.hpp.
Referenced by init(), and ~UavcanServers().
|
private |
Definition at line 135 of file uavcan_servers.hpp.
Referenced by get_next_active_node_id(), init(), and run().
|
private |
Definition at line 150 of file uavcan_servers.hpp.
Referenced by cb_getset(), and run().
|
private |
Definition at line 160 of file uavcan_servers.hpp.
|
private |
Definition at line 182 of file uavcan_servers.hpp.
Referenced by cb_getset(), param_count(), and run().
|
private |
Definition at line 154 of file uavcan_servers.hpp.
Referenced by cb_getset(), and run().
|
private |
Definition at line 155 of file uavcan_servers.hpp.
Referenced by cb_getset(), and run().
|
private |
Definition at line 157 of file uavcan_servers.hpp.
Referenced by run().
|
private |
Definition at line 156 of file uavcan_servers.hpp.
Referenced by run().
|
private |
Definition at line 158 of file uavcan_servers.hpp.
Referenced by run().
|
private |
Definition at line 183 of file uavcan_servers.hpp.
Referenced by param_opcode(), and run().
|
private |
Definition at line 166 of file uavcan_servers.hpp.
Referenced by cb_getset().
|
private |
Definition at line 184 of file uavcan_servers.hpp.
Referenced by cb_opcode(), and run().
|
private |
Definition at line 161 of file uavcan_servers.hpp.
Referenced by param_opcode(), and run().
|
private |
|
private |
Definition at line 131 of file uavcan_servers.hpp.
Referenced by init().
|
private |
Definition at line 127 of file uavcan_servers.hpp.
Referenced by get_next_active_node_id(), init(), and run().
|
private |
Definition at line 116 of file uavcan_servers.hpp.
Referenced by init(), run(), and ~UavcanServers().
|
private |
Definition at line 115 of file uavcan_servers.hpp.
|
private |
Definition at line 117 of file uavcan_servers.hpp.
|
private |
Definition at line 130 of file uavcan_servers.hpp.
Referenced by init().
|
private |
Definition at line 125 of file uavcan_servers.hpp.
Referenced by init().
|
staticprivate |
Definition at line 89 of file uavcan_servers.hpp.
Referenced by cb_enumeration_save(), cb_getset(), and run().
|
staticprivate |
Definition at line 87 of file uavcan_servers.hpp.
Referenced by cb_enumeration_save(), cb_getset(), and run().
|
staticprivate |
Definition at line 88 of file uavcan_servers.hpp.
Referenced by cb_enumeration_save().
|
staticprivate |
Definition at line 80 of file uavcan_servers.hpp.
|
staticprivate |
Definition at line 83 of file uavcan_servers.hpp.
Referenced by start().
|
staticprivate |
Definition at line 82 of file uavcan_servers.hpp.
Referenced by start().
|
staticprivate |
Definition at line 85 of file uavcan_servers.hpp.