orb_exists support for muorb

Also added builtin command wait_for_topic

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2016-06-21 10:39:30 -07:00
committed by Lorenz Meier
parent dc787830b5
commit 62a3e07423
15 changed files with 462 additions and 67 deletions

View File

@@ -489,6 +489,26 @@ int uORB::DeviceNode::unadvertise(orb_advert_t handle)
return PX4_OK;
}
int16_t uORB::DeviceNode::topic_advertised(const orb_metadata *meta, int priority)
{
uORBCommunicator::IChannel *ch = uORB::Manager::get_instance()->get_uorb_communicator();
if (ch != nullptr && meta != nullptr) {
return ch->topic_advertised(meta->o_name);
}
return -1;
}
/*
//TODO: Check if we need this since we only unadvertise when things all shutdown and it doesn't actually remove the device
int16_t uORB::DeviceNode::topic_unadvertised(const orb_metadata *meta, int priority)
{
uORBCommunicator::IChannel *ch = uORB::Manager::get_instance()->get_uorb_communicator();
if (ch != nullptr && meta != nullptr) {
return ch->topic_unadvertised(meta->o_name);
}
return -1;
}
*/
pollevent_t
uORB::DeviceNode::poll_state(device::file_t *filp)
{