41 #include <uavcan/uavcan.hpp> 59 virtual const char *
get_name()
const = 0;
65 virtual int init() = 0;
93 int class_instance = -1;
94 int orb_instance = -1;
101 bool _out_of_channels =
false;
104 static constexpr
unsigned DEFAULT_MAX_CHANNELS = 5;
108 const unsigned max_channels = DEFAULT_MAX_CHANNELS) :
109 device::CDev(name, devname),
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;
125 void publish(
const int node_id,
const void *report);
virtual unsigned get_num_redundant_channels() const =0
Returns number of active redundancy channels.
static void make_all(uavcan::INode &node, List< IUavcanSensorBridge *> &list)
Sensor bridge factory.
uORB published object driver.
API for the uORB lightweight object broker.
UavcanCDevSensorBridgeBase(const char *name, const char *devname, const char *class_devname, const orb_id_t orb_topic_sensor, const unsigned max_channels=DEFAULT_MAX_CHANNELS)
const char *const _class_devname
An intrusive linked list.
static constexpr unsigned MAX_NAME_LEN
Namespace encapsulating all device framework classes, functions and data.
Abstract class for any character device.
const unsigned _max_channels
This is the base class for redundant sensors with an independent ORB topic per each redundancy channe...
device identifier information
virtual const char * get_name() const =0
Returns ASCII name of the bridge.
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
virtual ~IUavcanSensorBridge()=default
const orb_id_t _orb_topic
virtual int init()=0
Starts the bridge.
virtual void print_status() const =0
Prints current status in a human readable format to stdout.
A sensor bridge class must implement this interface.