aboutsummaryrefslogtreecommitdiff
path: root/src/modules/uavcan/sensors/sensor_bridge.cpp
diff options
context:
space:
mode:
authorHolger Steinhaus <holger@steinhaus-home.de>2014-11-11 11:13:08 +0100
committerHolger Steinhaus <holger@steinhaus-home.de>2014-11-11 11:29:35 +0100
commit51ffb887c39ecfd0cb94879475f032ee65505321 (patch)
tree49acb3996936fafd953cda26c6df5d338e9d3841 /src/modules/uavcan/sensors/sensor_bridge.cpp
parent88093ebf1af5483d8b5c218adb1ea0c4798ee21e (diff)
downloadpx4-firmware-51ffb887c39ecfd0cb94879475f032ee65505321.tar.gz
px4-firmware-51ffb887c39ecfd0cb94879475f032ee65505321.tar.bz2
px4-firmware-51ffb887c39ecfd0cb94879475f032ee65505321.zip
UAVCAN: initialize device id for mag and baro to allow DEVIOCGDEVICEID ioctl to return useful data
Diffstat (limited to 'src/modules/uavcan/sensors/sensor_bridge.cpp')
-rw-r--r--src/modules/uavcan/sensors/sensor_bridge.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/uavcan/sensors/sensor_bridge.cpp b/src/modules/uavcan/sensors/sensor_bridge.cpp
index 9608ce680..0999938fc 100644
--- a/src/modules/uavcan/sensors/sensor_bridge.cpp
+++ b/src/modules/uavcan/sensors/sensor_bridge.cpp
@@ -103,6 +103,9 @@ void UavcanCDevSensorBridgeBase::publish(const int node_id, const void *report)
return;
}
+ // update device id as we now know our device node_id
+ _device_id.devid_s.address = static_cast<uint8_t>(node_id);
+
// Ask the CDev helper which class instance we can take
const int class_instance = register_class_devname(_class_devname);
if (class_instance < 0 || class_instance >= int(_max_channels)) {