mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
uORB::PublicationMulti add get_instance()
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
#include <px4_platform_common/defines.h>
|
#include <px4_platform_common/defines.h>
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
#include <uORB/uORB.h>
|
#include <uORB/uORB.h>
|
||||||
|
#include "uORBDeviceNode.hpp"
|
||||||
|
|
||||||
#include "Publication.hpp"
|
#include "Publication.hpp"
|
||||||
|
|
||||||
@@ -90,6 +91,15 @@ public:
|
|||||||
|
|
||||||
return (orb_publish(get_topic(), _handle, &data) == PX4_OK);
|
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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user