Merge remote-tracking branch 'upstream/master' into linux

Signed-off-by: Mark Charlebois <charlebm@gmail.com>

Conflicts:
	src/drivers/rgbled/rgbled.cpp
	src/modules/commander/PreflightCheck.cpp
	src/modules/commander/airspeed_calibration.cpp
	src/modules/commander/calibration_routines.cpp
	src/modules/commander/gyro_calibration.cpp
	src/modules/commander/mag_calibration.cpp
	src/modules/mc_att_control/mc_att_control_main.cpp
This commit is contained in:
Mark Charlebois
2015-04-28 11:48:26 -07:00
47 changed files with 935 additions and 656 deletions
+20
View File
@@ -41,6 +41,7 @@
#include <drivers/device/device.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
@@ -1196,6 +1197,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)
{
+9
View File
@@ -318,6 +318,15 @@ extern int orb_check(int handle, bool *updated) __EXPORT;
*/
extern int orb_stat(int handle, uint64_t *time) __EXPORT;
/**
* Check if a topic has already been created.
*
* @param meta ORB topic metadata.
* @param instance ORB instance
* @return OK if the topic exists, ERROR otherwise with errno set accordingly.
*/
extern int orb_exists(const struct orb_metadata *meta, int instance) __EXPORT;
/**
* Return the priority of the topic
*