src/modules/uORB/uORB.cpp
/**
 * Advertise a node; don't consider it an error if the node has
 * already been advertised.
 *
 * @todo verify that the existing node is the same as the one
 *       we tried to advertise.
 */
Advertise a node; don't consider it an error if the node has
already been advertised.

@todo verify that the existing node is the same as the one
we tried to advertise.
Advertise a node ; don ' t consider it an error if the node has already been advertised . @todo verify that the existing node is the same as the one we tried to advertise .
int
node_advertise(const struct orb_metadata *meta, int *instance = nullptr, int priority = ORB_PRIO_DEFAULT)
{
	int fd = -1;
	int ret = ERROR;
	const struct orb_advertdata adv = { meta, instance, priority };
	fd = open(TOPIC_MASTER_DEVICE_PATH, 0);
	if (fd < 0)
		goto out;
	ret = ioctl(fd, ORBIOCADVERTISE, (unsigned long)(uintptr_t)&adv);
	if ((OK != ret) && (EEXIST == errno)) {
		ret = OK;
	}
out:
	if (fd >= 0)
		close(fd);
	return ret;
}
int node_advertise ( const struct orb_metadata * meta , int * instance = nullptr , int priority = ORB_PRIO_DEFAULT ) { int fd = -1 ; int ret = ERROR ; const struct orb_advertdata adv = { meta , instance , priority } ; fd = open ( TOPIC_MASTER_DEVICE_PATH , 0 ) ; if ( fd < 0 ) goto out ; ret = ioctl ( fd , ORBIOCADVERTISE , ( unsigned long ) ( uintptr_t ) & adv ) ; if ( ( OK != ret ) && ( EEXIST == errno ) ) { ret = OK ; } out : if ( fd >= 0 ) close ( fd ) ; return ret ; }
Advertise a node; don't consider it an error if the node has
 already been advertised.
Advertise a node ; don ' t consider it an error if the node has already been advertised .
/* fill advertiser data */ /* open the control device */ /* advertise the object */ /* it's OK if it already exists */