64 for (
unsigned i = 0; i < _max_channels; i++) {
65 if (_channels[i].node_id >= 0) {
66 (void)unregister_class_devname(_class_devname, _channels[i].class_instance);
79 for (
unsigned i = 0; i < _max_channels; i++) {
80 if (_channels[i].node_id == node_id) {
81 channel = _channels + i;
87 if (channel ==
nullptr) {
88 if (_out_of_channels) {
95 for (
unsigned i = 0; i < _max_channels; i++) {
96 if (_channels[i].node_id < 0) {
97 channel = _channels + i;
103 if (channel ==
nullptr) {
104 _out_of_channels =
true;
110 _device_id.devid_s.address =
static_cast<uint8_t
>(node_id);
113 const int class_instance = register_class_devname(_class_devname);
115 if (class_instance < 0 || class_instance >=
int(_max_channels)) {
116 _out_of_channels =
true;
118 (void)unregister_class_devname(_class_devname, class_instance);
130 (void)unregister_class_devname(_class_devname, class_instance);
138 assert(channel !=
nullptr);
148 for (
unsigned i = 0; i < _max_channels; i++) {
149 if (_channels[i].node_id >= 0) {
160 printf(
"devname: %s\n", _class_devname);
162 for (
unsigned i = 0; i < _max_channels; i++) {
163 if (_channels[i].node_id >= 0) {
164 printf(
"channel %d: node id %d --> class instance %d\n",
165 i, _channels[i].node_id, _channels[i].class_instance);
168 printf(
"channel %d: empty\n", i);
static void make_all(uavcan::INode &node, List< IUavcanSensorBridge *> &list)
Sensor bridge factory.
virtual ~UavcanCDevSensorBridgeBase()
device identifier information
#define DEVICE_LOG(FMT,...)
int orb_publish(const struct orb_metadata *meta, orb_advert_t handle, const void *data)
UAVCAN <–> ORB bridge for GNSS messages: uavcan.equipment.gnss.Fix (deprecated, but still supported ...
void print_status() const override
Prints current status in a human readable format to stdout.
unsigned get_num_redundant_channels() const override
Returns number of active redundancy channels.
orb_advert_t orb_advertise_multi(const struct orb_metadata *meta, const void *data, int *instance, int priority)
void publish(const int node_id, const void *report)
Sends one measurement into appropriate ORB topic.