mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
uORB::PublicationMulti add get_instance()
This commit is contained in:
parent
0398a936e3
commit
c3fc96fd42
@ -41,6 +41,7 @@
|
||||
#include <px4_platform_common/defines.h>
|
||||
#include <systemlib/err.h>
|
||||
#include <uORB/uORB.h>
|
||||
#include "uORBDeviceNode.hpp"
|
||||
|
||||
#include "Publication.hpp"
|
||||
|
||||
@ -90,6 +91,15 @@ public:
|
||||
|
||||
return (orb_publish(get_topic(), _handle, &data) == PX4_OK);
|
||||
}
|
||||
|
||||
int get_instance() const
|
||||
{
|
||||
if (_handle) {
|
||||
return static_cast<uORB::DeviceNode *>(_handle)->get_instance();
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user