mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 00:50:34 +08:00
Nuttx: remove use of std::string, std::map, std::set
Nuttx complains about an unresolved _impure_ptr at link time. This is a known issue when using STL templates in NuttX on ARM. Created new ORBMap and ORBSet classes for NuttX. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -312,11 +312,11 @@ uORBCommunicator::IChannel* uORB::Manager::get_uorb_communicator( void )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
int16_t uORB::Manager::process_add_subscription(const std::string& messageName,
|
||||
int16_t uORB::Manager::process_add_subscription(const char *messageName,
|
||||
int32_t msgRateInHz)
|
||||
{
|
||||
warnx("[posix-uORB::Manager::process_add_subscription(%d)] entering Manager_process_add_subscription: name: %s",
|
||||
__LINE__, messageName.c_str() );
|
||||
__LINE__, messageName );
|
||||
int16_t rc = 0;
|
||||
_remote_subscriber_topics.insert( messageName );
|
||||
char nodepath[orb_maxpath];
|
||||
@@ -326,7 +326,7 @@ int16_t uORB::Manager::process_add_subscription(const std::string& messageName,
|
||||
uORB::DeviceNode* node = uORB::DeviceMaster::GetDeviceNode( nodepath );
|
||||
if ( node == nullptr) {
|
||||
warnx( "[posix-uORB::Manager::process_add_subscription(%d)]DeviceNode(%s) not created yet",
|
||||
__LINE__, messageName.c_str() );
|
||||
__LINE__, messageName );
|
||||
}
|
||||
else{
|
||||
// node is present.
|
||||
@@ -341,10 +341,10 @@ int16_t uORB::Manager::process_add_subscription(const std::string& messageName,
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
int16_t uORB::Manager::process_remove_subscription(
|
||||
const std::string& messageName)
|
||||
const char * messageName)
|
||||
{
|
||||
warnx("[posix-uORB::Manager::process_remove_subscription(%d)] Enter: name: %s",
|
||||
__LINE__, messageName.c_str() );
|
||||
__LINE__, messageName );
|
||||
int16_t rc = -1;
|
||||
_remote_subscriber_topics.erase( messageName );
|
||||
char nodepath[orb_maxpath];
|
||||
@@ -354,7 +354,7 @@ int16_t uORB::Manager::process_remove_subscription(
|
||||
// get the node name.
|
||||
if ( node == nullptr) {
|
||||
warnx("[posix-uORB::Manager::process_remove_subscription(%d)]Error No existing subscriber found for message: [%s]",
|
||||
__LINE__, messageName.c_str());
|
||||
__LINE__, messageName);
|
||||
} else {
|
||||
// node is present.
|
||||
node->process_remove_subscription();
|
||||
@@ -366,10 +366,10 @@ int16_t uORB::Manager::process_remove_subscription(
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
int16_t uORB::Manager::process_received_message(const std::string& messageName,
|
||||
int16_t uORB::Manager::process_received_message(const char * messageName,
|
||||
int32_t length, uint8_t* data)
|
||||
{
|
||||
//warnx("[uORB::Manager::process_received_message(%d)] Enter name: %s", __LINE__, messageName.c_str() );
|
||||
//warnx("[uORB::Manager::process_received_message(%d)] Enter name: %s", __LINE__, messageName );
|
||||
|
||||
int16_t rc = -1;
|
||||
char nodepath[orb_maxpath];
|
||||
@@ -379,7 +379,7 @@ int16_t uORB::Manager::process_received_message(const std::string& messageName,
|
||||
// get the node name.
|
||||
if ( node == nullptr) {
|
||||
warnx("[uORB::Manager::process_received_message(%d)]Error No existing subscriber found for message: [%s] nodepath:[%s]",
|
||||
__LINE__, messageName.c_str(), nodepath );
|
||||
__LINE__, messageName, nodepath );
|
||||
|
||||
} else {
|
||||
// node is present.
|
||||
@@ -390,7 +390,7 @@ int16_t uORB::Manager::process_received_message(const std::string& messageName,
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool uORB::Manager::is_remote_subscriber_present( const std::string& messageName )
|
||||
bool uORB::Manager::is_remote_subscriber_present( const char * messageName )
|
||||
{
|
||||
return ( _remote_subscriber_topics.find( messageName ) != _remote_subscriber_topics.end() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user