41 #include <uavcan/uavcan.hpp> 42 #include <drivers/device/device.h> 52 static constexpr
unsigned MAX_NAME_LEN = 20;
59 virtual const char *
get_name()
const = 0;
65 virtual int init() = 0;
93 int class_instance = -1;
94 int orb_instance = -1;
97 const unsigned _max_channels;
98 const char *
const _class_devname;
100 Channel *
const _channels;
101 bool _out_of_channels =
false;
104 static constexpr
unsigned DEFAULT_MAX_CHANNELS = 5;
108 const unsigned max_channels = DEFAULT_MAX_CHANNELS) :
110 _max_channels(max_channels),
111 _class_devname(class_devname),
112 _orb_topic(orb_topic_sensor),
113 _channels(
new Channel[max_channels])
115 _device_id.devid_s.bus_type = DeviceBusType_UAVCAN;
116 _device_id.devid_s.bus = 0;
125 void publish(
const int node_id,
const void *report);
An intrusive linked list.
uORB published object driver.
A sensor bridge class must implement this interface.
Definition: sensor_bridge.hpp:49
static void make_all(uavcan::INode &node, List< IUavcanSensorBridge *> &list)
Sensor bridge factory.
Definition: sensor_bridge.cpp:48
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
Definition: uORB.h:134
This is the base class for redundant sensors with an independent ORB topic per each redundancy channe...
Definition: sensor_bridge.hpp:88
virtual int init()=0
Starts the bridge.
Abstract class for any character device.
Definition: CDev.hpp:60
API for the uORB lightweight object broker.
virtual void print_status() const =0
Prints current status in a human readable format to stdout.
virtual const char * get_name() const =0
Returns ASCII name of the bridge.
virtual unsigned get_num_redundant_channels() const =0
Returns number of active redundancy channels.