mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 16:30:34 +08:00
Fixups after merge from master
MuORB was missing the orb_exists() function added to uORB.cpp gyro_calibration.cpp still had some merge conflicts that had not been resolved. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include <drivers/device/device.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
@@ -1235,6 +1236,25 @@ node_open(Flavor f, const struct orb_metadata *meta, const void *data, bool adve
|
||||
|
||||
} // namespace
|
||||
|
||||
int
|
||||
orb_exists(const struct orb_metadata *meta, int instance)
|
||||
{
|
||||
/*
|
||||
* Generate the path to the node and try to open it.
|
||||
*/
|
||||
char path[orb_maxpath];
|
||||
int inst = instance;
|
||||
int ret = node_mkpath(path, PUBSUB, meta, &inst);
|
||||
|
||||
if (ret != OK) {
|
||||
errno = -ret;
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
struct stat buffer;
|
||||
return stat(path, &buffer);
|
||||
}
|
||||
|
||||
orb_advert_t
|
||||
orb_advertise(const struct orb_metadata *meta, const void *data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user