mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 01:43:33 +08:00
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:
committed by
Lorenz Meier
parent
dc787830b5
commit
62a3e07423
@@ -158,6 +158,35 @@ int px4muorb_param_update_value_from_shmem(uint32_t param, const uint8_t *value,
|
||||
release_shmem_lock(__FILE__, __LINE__);
|
||||
|
||||
return 0;
|
||||
|
||||
int px4muorb_topic_advertised(const char *topic_name)
|
||||
{
|
||||
int rc = 0;
|
||||
PX4_INFO("TEST px4muorb_topic_advertised of [%s] on remote side...", topic_name);
|
||||
uORB::FastRpcChannel *channel = uORB::FastRpcChannel::GetInstance();
|
||||
uORBCommunicator::IChannelRxHandler *rxHandler = channel->GetRxHandler();
|
||||
|
||||
if (rxHandler != nullptr) {
|
||||
rc = rxHandler->process_remote_topic(topic_name, 1);
|
||||
} else {
|
||||
rc = -1;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int px4muorb_topic_unadvertised(const char *topic_name)
|
||||
{
|
||||
int rc = 0;
|
||||
PX4_INFO("TEST px4muorb_topic_unadvertised of [%s] on remote side...", topic_name);
|
||||
uORB::FastRpcChannel *channel = uORB::FastRpcChannel::GetInstance();
|
||||
uORBCommunicator::IChannelRxHandler *rxHandler = channel->GetRxHandler();
|
||||
|
||||
if (rxHandler != nullptr) {
|
||||
rc = rxHandler->process_remote_topic(topic_name, 0);
|
||||
} else {
|
||||
rc = -1;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int px4muorb_add_subscriber(const char *name)
|
||||
|
||||
Reference in New Issue
Block a user