38 #include <px4_platform_common/px4_config.h> 41 #include <uavcan/protocol/file/BeginFirmwareUpdate.hpp> 42 #include <uavcan/node/timer.hpp> 48 #define NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN 1 49 #define UAVCAN_DEVICE_PATH "/dev/uavcan/esc" 52 #define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+1) 90 typedef uavcan::Node<MemPoolSize>
Node;
94 UavcanEsc(uavcan::ICanDriver &can_driver, uavcan::ISystemClock &system_clock);
98 virtual int ioctl(
file *filp,
int cmd,
unsigned long arg);
100 static int start(uavcan::NodeID node_id, uint32_t bitrate);
118 int init(uavcan::NodeID node_id, uavcan_stm32::BusEvent &bus_events);
132 typedef uavcan::MethodBinder<
UavcanEsc *,
133 void (UavcanEsc::*)(
const uavcan::ReceivedDataStructure<UavcanEsc::BeginFirmwareUpdate::Request> &,
134 uavcan::ServiceResponseDataStructure<UavcanEsc::BeginFirmwareUpdate::Response> &)>
138 void cb_beginfirmware_update(
const uavcan::ReceivedDataStructure<UavcanEsc::BeginFirmwareUpdate::Request> &req,
139 uavcan::ServiceResponseDataStructure<UavcanEsc::BeginFirmwareUpdate::Response> &rsp);
145 uavcan::TimerEventForwarder<void (*)(const uavcan::TimerEvent &)>
_reset_timer;
uavcan::ServiceServer< BeginFirmwareUpdate, BeginFirmwareUpdateCallBack > _fw_update_listner
uavcan::protocol::file::BeginFirmwareUpdate BeginFirmwareUpdate
UavcanEsc(uavcan::ICanDriver &can_driver, uavcan::ISystemClock &system_clock)
uavcan::Node< MemPoolSize > Node
uavcan_stm32::CanInitHelper< RxQueueLenPerIface > CanInitHelper
static constexpr unsigned MemPoolSize
static int start(uavcan::NodeID node_id, uint32_t bitrate)
Abstract class for any character device.
Node _node
library instance
static void busevent_signal_trampoline()
uavcan::MethodBinder< UavcanEsc *, void(UavcanEsc::*)(const uavcan::ReceivedDataStructure< UavcanEsc::BeginFirmwareUpdate::Request > &, uavcan::ServiceResponseDataStructure< UavcanEsc::BeginFirmwareUpdate::Response > &)> BeginFirmwareUpdateCallBack
virtual int ioctl(file *filp, int cmd, unsigned long arg)
static constexpr unsigned RxQueueLenPerIface
uavcan::TimerEventForwarder< void(*)(const uavcan::TimerEvent &)> _reset_timer
static UavcanEsc * _instance
singleton pointer
void cb_beginfirmware_update(const uavcan::ReceivedDataStructure< UavcanEsc::BeginFirmwareUpdate::Request > &req, uavcan::ServiceResponseDataStructure< UavcanEsc::BeginFirmwareUpdate::Response > &rsp)
static constexpr unsigned StackSize
struct @83::@85::@87 file
static UavcanEsc * instance()
pthread_mutex_t _node_mutex
int _task
handle to the OS task
bool _task_should_exit
flag to indicate to tear down the CAN driver
px4_sem_t _sem
semaphore for scheduling the task