mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-09-26 04:38:19 +08:00
uORB: PublicationMulti get_instance() advertise if not already advertised
- fixes UAVCANv0 sensor bridge uORB usage, but also a reason thing to do in general
This commit is contained in:
@@ -92,9 +92,10 @@ public:
|
|||||||
return (orb_publish(get_topic(), _handle, &data) == PX4_OK);
|
return (orb_publish(get_topic(), _handle, &data) == PX4_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_instance() const
|
int get_instance()
|
||||||
{
|
{
|
||||||
if (_handle) {
|
// advertise if not already advertised
|
||||||
|
if (advertise()) {
|
||||||
return static_cast<uORB::DeviceNode *>(_handle)->get_instance();
|
return static_cast<uORB::DeviceNode *>(_handle)->get_instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user