mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +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:
parent
33d12db580
commit
f1f396e338
@ -92,9 +92,10 @@ public:
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user