LCOV - code coverage report
Current view: top level - AP_DroneCAN - AP_DroneCAN.h (source / functions) Hit Total Coverage
Test: lcov.info Lines: 4 5 80.0 %
Date: 2026-09-09 11:02:08 Functions: 3 4 75.0 %

          Line data    Source code
       1             : /*
       2             :  * This file is free software: you can redistribute it and/or modify it
       3             :  * under the terms of the GNU General Public License as published by the
       4             :  * Free Software Foundation, either version 3 of the License, or
       5             :  * (at your option) any later version.
       6             :  *
       7             :  * This file is distributed in the hope that it will be useful, but
       8             :  * WITHOUT ANY WARRANTY; without even the implied warranty of
       9             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      10             :  * See the GNU General Public License for more details.
      11             :  *
      12             :  * You should have received a copy of the GNU General Public License along
      13             :  * with this program.  If not, see <http://www.gnu.org/licenses/>.
      14             :  *
      15             :  * Author: Eugene Shamaev, Siddharth Bharat Purohit
      16             :  */
      17             : #pragma once
      18             : 
      19             : #include <AP_HAL/AP_HAL.h>
      20             : 
      21             : #if HAL_ENABLE_DRONECAN_DRIVERS
      22             : 
      23             : #include "AP_Canard_iface.h"
      24             : #include <AP_CANManager/AP_CANManager.h>
      25             : #include <AP_HAL/Semaphores.h>
      26             : #include <AP_Param/AP_Param.h>
      27             : #include <AP_ESC_Telem/AP_ESC_Telem_Backend.h>
      28             : #include <SRV_Channel/SRV_Channel_config.h>
      29             : #include <canard/publisher.h>
      30             : #include <canard/subscriber.h>
      31             : #include <canard/service_client.h>
      32             : #include <canard/service_server.h>
      33             : #include <stdio.h>
      34             : #include "AP_DroneCAN_DNA_Server.h"
      35             : #include <canard.h>
      36             : #include <dronecan_msgs.h>
      37             : #include <AP_SerialManager/AP_SerialManager_config.h>
      38             : #include <AP_Relay/AP_Relay_config.h>
      39             : #include <AP_Servo_Telem/AP_Servo_Telem_config.h>
      40             : #include <AP_Mount/AP_Mount_config.h>
      41             : 
      42             : #ifndef DRONECAN_SRV_NUMBER
      43             : #define DRONECAN_SRV_NUMBER NUM_SERVO_CHANNELS
      44             : #endif
      45             : 
      46             : #ifndef AP_DRONECAN_SEND_GPS
      47             : #define AP_DRONECAN_SEND_GPS (HAL_PROGRAM_SIZE_LIMIT_KB > 1024)
      48             : #endif
      49             : 
      50             : #define AP_DRONECAN_SW_VERS_MAJOR 1
      51             : #define AP_DRONECAN_SW_VERS_MINOR 0
      52             : 
      53             : #define AP_DRONECAN_HW_VERS_MAJOR 1
      54             : #define AP_DRONECAN_HW_VERS_MINOR 0
      55             : 
      56             : 
      57             : #ifndef AP_DRONECAN_HOBBYWING_ESC_SUPPORT
      58             : #define AP_DRONECAN_HOBBYWING_ESC_SUPPORT (HAL_PROGRAM_SIZE_LIMIT_KB>1024 && HAL_WITH_ESC_TELEM)
      59             : #endif
      60             : 
      61             : #ifndef AP_DRONECAN_HIMARK_SERVO_SUPPORT
      62             : #define AP_DRONECAN_HIMARK_SERVO_SUPPORT (HAL_PROGRAM_SIZE_LIMIT_KB>1024)
      63             : #endif
      64             : 
      65             : #ifndef AP_DRONECAN_SERIAL_ENABLED
      66             : #define AP_DRONECAN_SERIAL_ENABLED AP_SERIALMANAGER_REGISTER_ENABLED && (HAL_PROGRAM_SIZE_LIMIT_KB>1024)
      67             : #endif
      68             : 
      69             : #ifndef AP_DRONECAN_VOLZ_FEEDBACK_ENABLED
      70             : #define AP_DRONECAN_VOLZ_FEEDBACK_ENABLED 0
      71             : #endif
      72             : 
      73             : #ifndef AP_DRONECAN_LOG_CIRCUIT_STATUS_ENABLED
      74             : #define AP_DRONECAN_LOG_CIRCUIT_STATUS_ENABLED 0
      75             : #endif
      76             : 
      77             : #if AP_DRONECAN_SERIAL_ENABLED
      78             : #include "AP_DroneCAN_serial.h"
      79             : #endif
      80             : 
      81             : // fwd-declare callback classes
      82             : class AP_DroneCAN_DNA_Server;
      83             : class CANSensor;
      84             : 
      85             : class AP_DroneCAN : public AP_CANDriver, public AP_ESC_Telem_Backend {
      86             :     friend class AP_DroneCAN_DNA_Server;
      87             : public:
      88             :     AP_DroneCAN(const int driver_index);
      89             :     ~AP_DroneCAN();
      90             : 
      91             :     static const struct AP_Param::GroupInfo var_info[];
      92             : 
      93             :     // Return uavcan from @driver_index or nullptr if it's not ready or doesn't exist
      94             :     static AP_DroneCAN *get_dronecan(uint8_t driver_index);
      95             :     bool prearm_check(char* fail_msg, uint8_t fail_msg_len) const;
      96             : 
      97             :     __INITFUNC__ void init(uint8_t driver_index) override;
      98             :     bool add_interface(AP_HAL::CANIface* can_iface) override;
      99             : 
     100             :     // add an 11 bit auxillary driver
     101             :     bool add_11bit_driver(CANSensor *sensor) override;
     102             : 
     103             :     // handler for outgoing frames for auxillary drivers
     104             :     bool write_aux_frame(AP_HAL::CANFrame &out_frame, const uint32_t timeout_us) override;
     105             :     
     106          67 :     uint8_t get_driver_index() const { return _driver_index; }
     107             : 
     108             :     // define string with length structure
     109             :     struct string { uint8_t len; uint8_t data[128]; };
     110             : 
     111             :     FUNCTOR_TYPEDEF(ParamGetSetIntCb, bool, AP_DroneCAN*, const uint8_t, const char*, int32_t &);
     112             :     FUNCTOR_TYPEDEF(ParamGetSetFloatCb, bool, AP_DroneCAN*, const uint8_t, const char*, float &);
     113             :     FUNCTOR_TYPEDEF(ParamGetSetStringCb, bool, AP_DroneCAN*, const uint8_t, const char*, string &);
     114             :     FUNCTOR_TYPEDEF(ParamSaveCb, void, AP_DroneCAN*,  const uint8_t, bool);
     115             : 
     116             :     void send_node_status();
     117             : 
     118             :     ///// SRV output /////
     119             :     void SRV_push_servos(void);
     120             : 
     121             :     ///// LED /////
     122             :     bool led_write(uint8_t led_index, uint8_t red, uint8_t green, uint8_t blue);
     123             : 
     124             :     // buzzer
     125             :     void set_buzzer_tone(float frequency, float duration_s);
     126             : 
     127             :     // Send Reboot command
     128             :     // Note: Do not call this from outside UAVCAN thread context,
     129             :     // you can call this from dronecan callbacks and handlers.
     130             :     // THIS IS NOT A THREAD SAFE API!
     131             :     void send_reboot_request(uint8_t node_id);
     132             : 
     133             :     // get or set param value
     134             :     // returns true on success, false on failure
     135             :     // failures occur when waiting on node to respond to previous get or set request
     136             :     bool set_parameter_on_node(uint8_t node_id, const char *name, float value, ParamGetSetFloatCb *cb);
     137             :     bool set_parameter_on_node(uint8_t node_id, const char *name, int32_t value, ParamGetSetIntCb *cb);
     138             :     bool set_parameter_on_node(uint8_t node_id, const char *name, const string &value, ParamGetSetStringCb *cb);
     139             :     bool get_parameter_on_node(uint8_t node_id, const char *name, ParamGetSetFloatCb *cb);
     140             :     bool get_parameter_on_node(uint8_t node_id, const char *name, ParamGetSetIntCb *cb);
     141             :     bool get_parameter_on_node(uint8_t node_id, const char *name, ParamGetSetStringCb *cb);
     142             : 
     143             :     // Save parameters
     144             :     bool save_parameters_on_node(uint8_t node_id, ParamSaveCb *cb);
     145             : 
     146             :     // options bitmask
     147             :     enum class Options : uint16_t {
     148             :         DNA_CLEAR_DATABASE        = (1U<<0),
     149             :         DNA_IGNORE_DUPLICATE_NODE = (1U<<1),
     150             :         CANFD_ENABLED             = (1U<<2),
     151             :         DNA_IGNORE_UNHEALTHY_NODE = (1U<<3),
     152             :         USE_ACTUATOR_PWM          = (1U<<4),
     153             :         SEND_GNSS                 = (1U<<5),
     154             :         USE_HIMARK_SERVO          = (1U<<6),
     155             :         USE_HOBBYWING_ESC         = (1U<<7),
     156             :         ENABLE_STATS              = (1U<<8),
     157             :         ENABLE_FLEX_DEBUG         = (1U<<9),
     158             :         ALLOW_EXTENDED_AUX        = (1U<<10),
     159             :     };
     160             : 
     161             :     // check if a option is set
     162       22304 :     bool option_is_set(Options option) const {
     163       22304 :         return (uint16_t(_options.get()) & uint16_t(option)) != 0;
     164             :     }
     165             : 
     166             :     // check if a option is set and if it is then reset it to
     167             :     // 0. return true if it was set
     168             :     bool check_and_reset_option(Options option);
     169             : 
     170           1 :     CanardInterface& get_canard_iface() { return canard_iface; }
     171             : 
     172             :     Canard::Publisher<uavcan_equipment_indication_LightsCommand> rgb_led{canard_iface};
     173             :     Canard::Publisher<uavcan_equipment_indication_BeepCommand> buzzer{canard_iface};
     174             :     Canard::Publisher<uavcan_equipment_gnss_RTCMStream> rtcm_stream{canard_iface};
     175             : 
     176             : #if HAL_MOUNT_XACTI_ENABLED
     177             :     // xacti specific publishers
     178             :     Canard::Publisher<com_xacti_CopterAttStatus> xacti_copter_att_status{canard_iface};
     179             :     Canard::Publisher<com_xacti_GimbalControlData> xacti_gimbal_control_data{canard_iface};
     180             :     Canard::Publisher<com_xacti_GnssStatus> xacti_gnss_status{canard_iface};
     181             : #endif  // HAL_MOUNT_XACTI_ENABLED
     182             : 
     183             : #if AP_RELAY_DRONECAN_ENABLED
     184             :     // Hardpoint for relay
     185             :     // Needs to be public so relay can edge trigger as well as streaming
     186             :     Canard::Publisher<uavcan_equipment_hardpoint_Command> relay_hardpoint{canard_iface};
     187             : #endif
     188             : 
     189             : #if AP_SCRIPTING_ENABLED
     190             :     bool get_FlexDebug(uint8_t node_id, uint16_t msg_id, uint32_t &timestamp_us, dronecan_protocol_FlexDebug &msg) const;
     191             : #endif
     192             : 
     193             : private:
     194             :     void loop(void);
     195             : 
     196             :     ///// SRV output /////
     197             :     void SRV_send_actuator();
     198             :     void SRV_send_esc();
     199             : #if AP_DRONECAN_HIMARK_SERVO_SUPPORT
     200             :     void SRV_send_himark();
     201             : #endif
     202             : 
     203             :     //scale servo output appropriately before sending
     204             :     int16_t scale_esc_output(uint8_t idx);
     205             : 
     206             :     // SafetyState
     207             :     void safety_state_send();
     208             : 
     209             :     // send notify vehicle state
     210             :     void notify_state_send();
     211             : 
     212             :     // check for parameter get/set response timeout
     213             :     void check_parameter_callback_timeout();
     214             : 
     215             :     // send queued parameter get/set request. called from loop
     216             :     void send_parameter_request();
     217             :     
     218             :     // send queued parameter save request. called from loop
     219             :     void send_parameter_save_request();
     220             : 
     221             :     // periodic logging
     222             :     void logging();
     223             :     
     224             :     // get parameter on a node
     225             :     ParamGetSetIntCb *param_int_cb;         // latest get param request callback function (for integers)
     226             :     ParamGetSetFloatCb *param_float_cb;     // latest get param request callback function (for floats)
     227             :     ParamGetSetStringCb *param_string_cb;   // latest get param request callback function (for strings)
     228             :     bool param_request_sent = true;         // true after a param request has been sent, false when queued to be sent
     229             :     uint32_t param_request_sent_ms;         // system time that get param request was sent
     230             :     HAL_Semaphore _param_sem;               // semaphore protecting this block of variables
     231             :     uint8_t param_request_node_id;          // node id of most recent get param request
     232             : 
     233             :     // save parameters on a node
     234             :     ParamSaveCb *save_param_cb;             // latest save param request callback function
     235             :     bool param_save_request_sent = true;    // true after a save param request has been sent, false when queued to be sent
     236             :     HAL_Semaphore _param_save_sem;          // semaphore protecting this block of variables
     237             :     uint8_t param_save_request_node_id;     // node id of most recent save param request
     238             : 
     239             :     // UAVCAN parameters
     240             :     AP_Int8 _dronecan_node;
     241             :     AP_Int32 _servo_bm;
     242             :     AP_Int32 _esc_bm;
     243             :     AP_Int8 _esc_offset;
     244             :     AP_Int16 _servo_rate_hz;
     245             :     AP_Int16 _options;
     246             :     AP_Int16 _notify_state_hz;
     247             :     AP_Int16 _pool_size;
     248             :     AP_Int32 _esc_rv;
     249             : 
     250             :     uint32_t *mem_pool;
     251             : 
     252             :     uint8_t _driver_index;
     253             : 
     254             :     CanardInterface canard_iface;
     255             : 
     256             :     AP_DroneCAN_DNA_Server _dna_server;
     257             : 
     258             :     char _thread_name[13];
     259             :     bool _initialized;
     260             :     ///// SRV output /////
     261             :     struct {
     262             :         uint16_t pulse;
     263             :         bool esc_pending;
     264             :         bool servo_pending;
     265             :     } _SRV_conf[DRONECAN_SRV_NUMBER];
     266             : 
     267             :     uint32_t _esc_send_count;
     268             :     uint32_t _srv_send_count;
     269             :     uint32_t _fail_send_count;
     270             : 
     271             :     uint32_t _SRV_armed_mask; // mask of servo outputs that are active
     272             :     uint32_t _ESC_armed_mask; // mask of ESC outputs that are active
     273             :     uint32_t _SRV_last_send_us;
     274             :     HAL_Semaphore SRV_sem;
     275             : 
     276             :     // last log time
     277             :     uint32_t last_log_ms;
     278             : 
     279             : #if AP_DRONECAN_SEND_GPS
     280             :     // send GNSS Fix and yaw, same thing AP_GPS_DroneCAN would receive
     281             :     void gnss_send_fix();
     282             :     void gnss_send_yaw();
     283             :     
     284             :     // GNSS Fix and Status
     285             :     struct {
     286             :         uint32_t last_gps_lib_fix_ms;
     287             :         uint32_t last_send_status_ms;
     288             :         uint32_t last_lib_yaw_time_ms;
     289             :     } _gnss;
     290             : #endif
     291             : 
     292             :     // node status send
     293             :     uint32_t _node_status_last_send_ms;
     294             : 
     295             :     // safety status send state
     296             :     uint32_t _last_safety_state_ms;
     297             : 
     298             :     // notify vehicle state
     299             :     uint32_t _last_notify_state_ms;
     300             :     uavcan_protocol_NodeStatus node_status_msg;
     301             : 
     302             : #if AP_RELAY_DRONECAN_ENABLED
     303             :     void relay_hardpoint_send();
     304             :     struct {
     305             :         AP_Int16 rate_hz;
     306             :         uint32_t last_send_ms;
     307             :         uint8_t last_index;
     308             :     } _relay;
     309             : #endif
     310             : 
     311             : #if AP_DRONECAN_SERIAL_ENABLED
     312             :     AP_DroneCAN_Serial serial;
     313             : #endif
     314             : 
     315             :     Canard::Publisher<uavcan_protocol_NodeStatus> node_status{canard_iface};
     316             :     Canard::Publisher<dronecan_protocol_CanStats> can_stats{canard_iface};
     317             :     Canard::Publisher<dronecan_protocol_Stats> protocol_stats{canard_iface};
     318             :     Canard::Publisher<uavcan_equipment_actuator_ArrayCommand> act_out_array{canard_iface};
     319             :     Canard::Publisher<uavcan_equipment_esc_RawCommand> esc_raw{canard_iface};
     320             :     Canard::Publisher<ardupilot_indication_SafetyState> safety_state{canard_iface};
     321             :     Canard::Publisher<uavcan_equipment_safety_ArmingStatus> arming_status{canard_iface};
     322             :     Canard::Publisher<ardupilot_indication_NotifyState> notify_state{canard_iface};
     323             : 
     324             : #if AP_DRONECAN_HIMARK_SERVO_SUPPORT
     325             :     Canard::Publisher<com_himark_servo_ServoCmd> himark_out{canard_iface};
     326             : #endif
     327             : 
     328             : #if AP_DRONECAN_SEND_GPS
     329             :     Canard::Publisher<uavcan_equipment_gnss_Fix2> gnss_fix2{canard_iface};
     330             :     Canard::Publisher<uavcan_equipment_gnss_Auxiliary> gnss_auxiliary{canard_iface};
     331             :     Canard::Publisher<ardupilot_gnss_Heading> gnss_heading{canard_iface};
     332             :     Canard::Publisher<ardupilot_gnss_Status> gnss_status{canard_iface};
     333             : #endif
     334             :     // incoming messages
     335             :     Canard::ObjCallback<AP_DroneCAN, ardupilot_indication_Button> safety_button_cb{this, &AP_DroneCAN::handle_button};
     336             :     Canard::Subscriber<ardupilot_indication_Button> safety_button_listener{safety_button_cb, _driver_index};
     337             : 
     338             :     Canard::ObjCallback<AP_DroneCAN, ardupilot_equipment_trafficmonitor_TrafficReport> traffic_report_cb{this, &AP_DroneCAN::handle_traffic_report};
     339             :     Canard::Subscriber<ardupilot_equipment_trafficmonitor_TrafficReport> traffic_report_listener{traffic_report_cb, _driver_index};
     340             : 
     341             : #if AP_SERVO_TELEM_ENABLED
     342             :     Canard::ObjCallback<AP_DroneCAN, uavcan_equipment_actuator_Status> actuator_status_cb{this, &AP_DroneCAN::handle_actuator_status};
     343             :     Canard::Subscriber<uavcan_equipment_actuator_Status> actuator_status_listener{actuator_status_cb, _driver_index};
     344             : #endif
     345             : 
     346             : #if AP_SERVO_TELEM_ENABLED || AP_DRONECAN_LOG_CIRCUIT_STATUS_ENABLED
     347             :     Canard::ObjCallback<AP_DroneCAN, uavcan_equipment_power_CircuitStatus> circuit_status_cb{this, &AP_DroneCAN::handle_circuit_status};
     348             :     Canard::Subscriber<uavcan_equipment_power_CircuitStatus> circuit_status_listener{circuit_status_cb, _driver_index};
     349             : #endif
     350             : 
     351             :     Canard::ObjCallback<AP_DroneCAN, uavcan_equipment_esc_Status> esc_status_cb{this, &AP_DroneCAN::handle_ESC_status};
     352             :     Canard::Subscriber<uavcan_equipment_esc_Status> esc_status_listener{esc_status_cb, _driver_index};
     353             : 
     354             : #if AP_EXTENDED_ESC_TELEM_ENABLED
     355             :     Canard::ObjCallback<AP_DroneCAN, uavcan_equipment_esc_StatusExtended> esc_status_extended_cb{this, &AP_DroneCAN::handle_esc_ext_status};
     356             :     Canard::Subscriber<uavcan_equipment_esc_StatusExtended> esc_status_extended_listener{esc_status_extended_cb, _driver_index};
     357             : #endif
     358             : 
     359             :     Canard::ObjCallback<AP_DroneCAN, uavcan_protocol_debug_LogMessage> debug_cb{this, &AP_DroneCAN::handle_debug};
     360             :     Canard::Subscriber<uavcan_protocol_debug_LogMessage> debug_listener{debug_cb, _driver_index};
     361             : 
     362             : #if AP_DRONECAN_HIMARK_SERVO_SUPPORT && AP_SERVO_TELEM_ENABLED
     363             :     Canard::ObjCallback<AP_DroneCAN, com_himark_servo_ServoInfo> himark_servo_ServoInfo_cb{this, &AP_DroneCAN::handle_himark_servoinfo};
     364             :     Canard::Subscriber<com_himark_servo_ServoInfo> himark_servo_ServoInfo_cb_listener{himark_servo_ServoInfo_cb, _driver_index};
     365             : #endif
     366             : #if AP_DRONECAN_VOLZ_FEEDBACK_ENABLED
     367             :     Canard::ObjCallback<AP_DroneCAN, com_volz_servo_ActuatorStatus> volz_servo_ActuatorStatus_cb{this, &AP_DroneCAN::handle_actuator_status_Volz};
     368             :     Canard::Subscriber<com_volz_servo_ActuatorStatus> volz_servo_ActuatorStatus_listener{volz_servo_ActuatorStatus_cb, _driver_index};
     369             : #endif
     370             : 
     371             :     // param client
     372             :     Canard::ObjCallback<AP_DroneCAN, uavcan_protocol_param_GetSetResponse> param_get_set_res_cb{this, &AP_DroneCAN::handle_param_get_set_response};
     373             :     Canard::Client<uavcan_protocol_param_GetSetResponse> param_get_set_client{canard_iface, param_get_set_res_cb};
     374             : 
     375             :     Canard::ObjCallback<AP_DroneCAN, uavcan_protocol_param_ExecuteOpcodeResponse> param_save_res_cb{this, &AP_DroneCAN::handle_param_save_response};
     376             :     Canard::Client<uavcan_protocol_param_ExecuteOpcodeResponse> param_save_client{canard_iface, param_save_res_cb};
     377             : 
     378             :     // reboot client
     379           0 :     void handle_restart_node_response(const CanardRxTransfer& transfer, const uavcan_protocol_RestartNodeResponse& msg) {}
     380             :     Canard::ObjCallback<AP_DroneCAN, uavcan_protocol_RestartNodeResponse> restart_node_res_cb{this, &AP_DroneCAN::handle_restart_node_response};
     381             :     Canard::Client<uavcan_protocol_RestartNodeResponse> restart_node_client{canard_iface, restart_node_res_cb};
     382             : 
     383             :     uavcan_protocol_param_ExecuteOpcodeRequest param_save_req;
     384             :     uavcan_protocol_param_GetSetRequest param_getset_req;
     385             : 
     386             :     // Node Info Server
     387             :     Canard::ObjCallback<AP_DroneCAN, uavcan_protocol_GetNodeInfoRequest> node_info_req_cb{this, &AP_DroneCAN::handle_node_info_request};
     388             :     Canard::Server<uavcan_protocol_GetNodeInfoRequest> node_info_server{canard_iface, node_info_req_cb};
     389             :     uavcan_protocol_GetNodeInfoResponse node_info_rsp;
     390             : 
     391             : #if AP_SCRIPTING_ENABLED
     392             :     Canard::ObjCallback<AP_DroneCAN, dronecan_protocol_FlexDebug> FlexDebug_cb{this, &AP_DroneCAN::handle_FlexDebug};
     393             :     Canard::Subscriber<dronecan_protocol_FlexDebug> FlexDebug_listener{FlexDebug_cb, _driver_index};
     394             : #endif
     395             :     
     396             : #if AP_DRONECAN_HOBBYWING_ESC_SUPPORT
     397             :     /*
     398             :       Hobbywing ESC support. Note that we need additional meta-data as
     399             :       the status messages do not have an ESC ID in them, so we need a
     400             :       mapping from node ID
     401             :     */
     402             :     #define HOBBYWING_MAX_ESC 8
     403             :     struct {
     404             :         uint32_t last_GetId_send_ms;
     405             :         uint8_t thr_chan[HOBBYWING_MAX_ESC];
     406             :     } hobbywing;
     407             :     void hobbywing_ESC_update();
     408             : 
     409             :     void SRV_send_esc_hobbywing();
     410             :     Canard::Publisher<com_hobbywing_esc_RawCommand> esc_hobbywing_raw{canard_iface};
     411             :     Canard::Publisher<com_hobbywing_esc_GetEscID> esc_hobbywing_GetEscID{canard_iface};
     412             :     Canard::ObjCallback<AP_DroneCAN, com_hobbywing_esc_GetEscID> esc_hobbywing_GetEscID_cb{this, &AP_DroneCAN::handle_hobbywing_GetEscID};
     413             :     Canard::Subscriber<com_hobbywing_esc_GetEscID> esc_hobbywing_GetEscID_listener{esc_hobbywing_GetEscID_cb, _driver_index};
     414             :     Canard::ObjCallback<AP_DroneCAN, com_hobbywing_esc_StatusMsg1> esc_hobbywing_StatusMSG1_cb{this, &AP_DroneCAN::handle_hobbywing_StatusMsg1};
     415             :     Canard::Subscriber<com_hobbywing_esc_StatusMsg1> esc_hobbywing_StatusMSG1_listener{esc_hobbywing_StatusMSG1_cb, _driver_index};
     416             :     Canard::ObjCallback<AP_DroneCAN, com_hobbywing_esc_StatusMsg2> esc_hobbywing_StatusMSG2_cb{this, &AP_DroneCAN::handle_hobbywing_StatusMsg2};
     417             :     Canard::Subscriber<com_hobbywing_esc_StatusMsg2> esc_hobbywing_StatusMSG2_listener{esc_hobbywing_StatusMSG2_cb, _driver_index};
     418             :     bool hobbywing_find_esc_index(uint8_t node_id, uint8_t &esc_index) const;
     419             :     void handle_hobbywing_GetEscID(const CanardRxTransfer& transfer, const com_hobbywing_esc_GetEscID& msg);
     420             :     void handle_hobbywing_StatusMsg1(const CanardRxTransfer& transfer, const com_hobbywing_esc_StatusMsg1& msg);
     421             :     void handle_hobbywing_StatusMsg2(const CanardRxTransfer& transfer, const com_hobbywing_esc_StatusMsg2& msg);
     422             : #endif // AP_DRONECAN_HOBBYWING_ESC_SUPPORT
     423             : 
     424             : #if AP_DRONECAN_HIMARK_SERVO_SUPPORT && AP_SERVO_TELEM_ENABLED
     425             :     void handle_himark_servoinfo(const CanardRxTransfer& transfer, const com_himark_servo_ServoInfo &msg);
     426             : #endif
     427             : 
     428             :     // incoming button handling
     429             :     void handle_button(const CanardRxTransfer& transfer, const ardupilot_indication_Button& msg);
     430             :     void handle_traffic_report(const CanardRxTransfer& transfer, const ardupilot_equipment_trafficmonitor_TrafficReport& msg);
     431             : #if AP_SERVO_TELEM_ENABLED
     432             :     void handle_actuator_status(const CanardRxTransfer& transfer, const uavcan_equipment_actuator_Status& msg);
     433             : #endif
     434             : #if AP_SERVO_TELEM_ENABLED || AP_DRONECAN_LOG_CIRCUIT_STATUS_ENABLED
     435             :     void handle_circuit_status(const CanardRxTransfer& transfer, const uavcan_equipment_power_CircuitStatus& msg);
     436             : #endif
     437             : #if AP_DRONECAN_VOLZ_FEEDBACK_ENABLED
     438             :     void handle_actuator_status_Volz(const CanardRxTransfer& transfer, const com_volz_servo_ActuatorStatus& msg);
     439             : #endif
     440             :     void handle_ESC_status(const CanardRxTransfer& transfer, const uavcan_equipment_esc_Status& msg);
     441             : #if AP_EXTENDED_ESC_TELEM_ENABLED
     442             :     void handle_esc_ext_status(const CanardRxTransfer& transfer, const uavcan_equipment_esc_StatusExtended& msg);
     443             : #endif
     444             :     static bool is_esc_data_index_valid(const uint8_t index);
     445             :     void handle_debug(const CanardRxTransfer& transfer, const uavcan_protocol_debug_LogMessage& msg);
     446             :     void handle_param_get_set_response(const CanardRxTransfer& transfer, const uavcan_protocol_param_GetSetResponse& rsp);
     447             :     void handle_param_save_response(const CanardRxTransfer& transfer, const uavcan_protocol_param_ExecuteOpcodeResponse& rsp);
     448             :     void handle_node_info_request(const CanardRxTransfer& transfer, const uavcan_protocol_GetNodeInfoRequest& req);
     449             : 
     450             : #if AP_SCRIPTING_ENABLED
     451             :     void handle_FlexDebug(const CanardRxTransfer& transfer, const dronecan_protocol_FlexDebug& msg);
     452             :     struct FlexDebug {
     453             :         struct FlexDebug *next;
     454             :         uint32_t timestamp_us;
     455             :         uint8_t node_id;
     456             :         dronecan_protocol_FlexDebug msg;
     457             :     } *flexDebug_list;
     458             : #endif
     459             : };
     460             : 
     461             : #endif // #if HAL_ENABLE_DRONECAN_DRIVERS

Generated by: LCOV version 1.14