36 #include <px4_platform_common/px4_config.h> 39 #include <uavcan/protocol/global_time_sync_slave.hpp> 40 #include <uavcan/protocol/file/BeginFirmwareUpdate.hpp> 41 #include <uavcan/node/timer.hpp> 51 #define NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN 1 52 #define UAVCAN_DEVICE_PATH "/dev/uavcan/node" 55 #define UAVCAN_NUM_POLL_FDS (NUM_ACTUATOR_CONTROL_GROUPS_UAVCAN+1) 93 typedef uavcan::Node<MemPoolSize>
Node;
97 UavcanNode(uavcan::ICanDriver &can_driver, uavcan::ISystemClock &system_clock);
101 virtual int ioctl(
file *filp,
int cmd,
unsigned long arg);
103 static int start(uavcan::NodeID node_id, uint32_t bitrate);
121 int init(uavcan::NodeID node_id, uavcan_stm32::BusEvent &bus_events);
137 void (UavcanNode::*)(
const uavcan::ReceivedDataStructure<UavcanNode::BeginFirmwareUpdate::Request> &,
138 uavcan::ServiceResponseDataStructure<UavcanNode::BeginFirmwareUpdate::Response> &)>
142 void cb_beginfirmware_update(
const uavcan::ReceivedDataStructure<UavcanNode::BeginFirmwareUpdate::Request> &req,
143 uavcan::ServiceResponseDataStructure<UavcanNode::BeginFirmwareUpdate::Response> &rsp);
149 uavcan::TimerEventForwarder<void (*)(const uavcan::TimerEvent &)>
_reset_timer;
static int start(uavcan::NodeID node_id, uint32_t bitrate)
uavcan_stm32::CanInitHelper< RxQueueLenPerIface > CanInitHelper
uavcan::Node _node
library instance
static constexpr unsigned MemPoolSize
static void busevent_signal_trampoline()
pthread_mutex_t _node_mutex
uavcan::Node< MemPoolSize > Node
uavcan::ServiceServer< BeginFirmwareUpdate, BeginFirmwareUpdateCallBack > _fw_update_listner
uavcan::TimerEventForwarder< void(*)(const uavcan::TimerEvent &)> _reset_timer
px4::atomic_bool _task_should_exit
flag to indicate to tear down the CAN driver
UavcanNode(uavcan::ICanDriver &can_driver, uavcan::ISystemClock &system_clock)
Abstract class for any character device.
px4_sem_t _sem
semaphore for scheduling the task
void cb_beginfirmware_update(const uavcan::ReceivedDataStructure< UavcanNode::BeginFirmwareUpdate::Request > &req, uavcan::ServiceResponseDataStructure< UavcanNode::BeginFirmwareUpdate::Response > &rsp)
static constexpr unsigned StackSize
Node _node
library instance
static UavcanNode * _instance
singleton pointer
uavcan::MethodBinder< UavcanNode *, void(UavcanNode::*)(const uavcan::ReceivedDataStructure< UavcanNode::BeginFirmwareUpdate::Request > &, uavcan::ServiceResponseDataStructure< UavcanNode::BeginFirmwareUpdate::Response > &)> BeginFirmwareUpdateCallBack
static UavcanNode * instance()
struct @83::@85::@87 file
uavcan::protocol::file::BeginFirmwareUpdate BeginFirmwareUpdate
uavcan::GlobalTimeSyncSlave _time_sync_slave
static constexpr unsigned RxQueueLenPerIface
int _task
handle to the OS task
virtual int ioctl(file *filp, int cmd, unsigned long arg)