mirror of https://github.com/ArduPilot/ardupilot
AP_DroneCAN: pass all the variables to AP_DroneCAN_DNA_Server by value
we were using the values by the AP_DroneCAN object, but the members might not have been initialised if they are out of order
This commit is contained in:
parent
1127d1e678
commit
34494bb7d1
|
@ -149,7 +149,7 @@ const AP_Param::GroupInfo AP_DroneCAN::var_info[] = {
|
|||
AP_DroneCAN::AP_DroneCAN(const int driver_index) :
|
||||
_driver_index(driver_index),
|
||||
canard_iface(driver_index),
|
||||
_dna_server(*this)
|
||||
_dna_server(*this, canard_iface, driver_index)
|
||||
{
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
|
|
|
@ -36,12 +36,12 @@ extern const AP_HAL::HAL& hal;
|
|||
|
||||
#define debug_dronecan(level_debug, fmt, args...) do { AP::can().log_text(level_debug, "DroneCAN", fmt, ##args); } while (0)
|
||||
|
||||
AP_DroneCAN_DNA_Server::AP_DroneCAN_DNA_Server(AP_DroneCAN &ap_dronecan) :
|
||||
AP_DroneCAN_DNA_Server::AP_DroneCAN_DNA_Server(AP_DroneCAN &ap_dronecan, CanardInterface &canard_iface, uint8_t driver_index) :
|
||||
_ap_dronecan(ap_dronecan),
|
||||
_canard_iface(ap_dronecan.canard_iface),
|
||||
_canard_iface(canard_iface),
|
||||
storage(StorageManager::StorageCANDNA),
|
||||
allocation_sub(allocation_cb, _ap_dronecan.get_driver_index()),
|
||||
node_status_sub(node_status_cb, _ap_dronecan.get_driver_index()),
|
||||
allocation_sub(allocation_cb, driver_index),
|
||||
node_status_sub(node_status_cb, driver_index),
|
||||
node_info_client(_canard_iface, node_info_cb)
|
||||
{}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ class AP_DroneCAN_DNA_Server
|
|||
Canard::Client<uavcan_protocol_GetNodeInfoResponse> node_info_client;
|
||||
|
||||
public:
|
||||
AP_DroneCAN_DNA_Server(AP_DroneCAN &ap_dronecan);
|
||||
AP_DroneCAN_DNA_Server(AP_DroneCAN &ap_dronecan, CanardInterface &canard_iface, uint8_t driver_index);
|
||||
|
||||
|
||||
// Do not allow copies
|
||||
|
|
Loading…
Reference in New Issue