PX4 Firmware
PX4 Autopilot Software http://px4.io
uORB::KraitFastRpcChannel Class Reference

#include <uORBKraitFastRpcChannel.hpp>

Inheritance diagram for uORB::KraitFastRpcChannel:
Collaboration diagram for uORB::KraitFastRpcChannel:

Classes

struct  BulkTransferHeader
 

Public Member Functions

virtual int16_t topic_advertised (const char *messageName)
 Interface to notify the remote entity of a topic being advertised. More...
 
virtual int16_t topic_unadvertised (const char *messageName)
 Interface to notify the remote entity of a topic being unadvertised and is no longer publishing messages. More...
 
virtual int16_t add_subscription (const char *messageName, int32_t msgRateInHz)
 Interface to notify the remote entity of interest of a subscription for a message. More...
 
virtual int16_t remove_subscription (const char *messageName)
 Interface to notify the remote entity of removal of a subscription. More...
 
virtual int16_t register_handler (uORBCommunicator::IChannelRxHandler *handler)
 Register Message Handler. More...
 
virtual int16_t send_message (const char *messageName, int32_t length, uint8_t *data)
 Sends the data message over the communication link. More...
 
void Start ()
 
void Stop ()
 

Static Public Member Functions

static uORB::KraitFastRpcChannelGetInstance ()
 static method to get the IChannel Implementor. More...
 
static bool isInstance ()
 Static method to check if there is an instance. More...
 

Private Member Functions

 KraitFastRpcChannel ()
 constructor. More...
 
void fastrpc_recv_thread ()
 

Static Private Member Functions

static void * thread_start (void *handler)
 

Private Attributes

uORBCommunicator::IChannelRxHandler_RxHandler
 
pthread_t _RecvThread
 
bool _ThreadStarted
 
bool _ThreadShouldExit
 
px4muorb::KraitRpcWrapper _KraitWrapper
 
std::map< std::string, int32_t > _AdspSubscriberCache
 
std::map< std::string, hrt_abstime_AdspSubscriberSampleTimestamp
 

Static Private Attributes

static uORB::KraitFastRpcChannel_InstancePtr = nullptr
 
static const int32_t _CONTROL_MSG_TYPE_ADD_SUBSCRIBER = 1
 
static const int32_t _CONTROL_MSG_TYPE_REMOVE_SUBSCRIBER = 2
 
static const int32_t _DATA_MSG_TYPE = 3
 
static const int32_t _CONTROL_MSG_TYPE_ADVERTISE = 4
 
static const int32_t _CONTROL_MSG_TYPE_UNADVERTISE = 5
 
static const hrt_abstime _SubCacheRefreshRate = 1000000
 

Detailed Description

Definition at line 50 of file uORBKraitFastRpcChannel.hpp.

Constructor & Destructor Documentation

◆ KraitFastRpcChannel()

uORB::KraitFastRpcChannel::KraitFastRpcChannel ( )
private

constructor.

Definition at line 63 of file uORBKraitFastRpcChannel.cpp.

References _KraitWrapper, and px4muorb::KraitRpcWrapper::Initialize().

Here is the call graph for this function:

Member Function Documentation

◆ add_subscription()

int16_t uORB::KraitFastRpcChannel::add_subscription ( const char *  messageName,
int32_t  msgRateInHz 
)
virtual

Interface to notify the remote entity of interest of a subscription for a message.

Parameters
messageNameThis represents the uORB message name; This message name should be globally unique.
msgRateThe max rate at which the subscriber can accept the messages.
Returns
0 = success; This means the messages is successfully sent to the receiver Note: This does not mean that the receiver as received it. otherwise = failure.

Implements uORBCommunicator::IChannel.

Definition at line 89 of file uORBKraitFastRpcChannel.cpp.

References _KraitWrapper, and px4muorb::KraitRpcWrapper::AddSubscriber().

Referenced by isInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastrpc_recv_thread()

◆ GetInstance()

static uORB::KraitFastRpcChannel* uORB::KraitFastRpcChannel::GetInstance ( )
inlinestatic

static method to get the IChannel Implementor.

Definition at line 56 of file uORBKraitFastRpcChannel.hpp.

References _InstancePtr.

Referenced by muorb_main().

Here is the caller graph for this function:

◆ isInstance()

static bool uORB::KraitFastRpcChannel::isInstance ( )
inlinestatic

Static method to check if there is an instance.

Definition at line 68 of file uORBKraitFastRpcChannel.hpp.

References _InstancePtr, add_subscription(), data, register_handler(), remove_subscription(), send_message(), Start(), Stop(), topic_advertised(), and topic_unadvertised().

Referenced by muorb_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_handler()

int16_t uORB::KraitFastRpcChannel::register_handler ( uORBCommunicator::IChannelRxHandler handler)
virtual

Register Message Handler.

This is internal for the IChannel implementer*

Implements uORBCommunicator::IChannel.

Definition at line 107 of file uORBKraitFastRpcChannel.cpp.

References _RxHandler.

Referenced by isInstance().

Here is the caller graph for this function:

◆ remove_subscription()

int16_t uORB::KraitFastRpcChannel::remove_subscription ( const char *  messageName)
virtual

Interface to notify the remote entity of removal of a subscription.

Parameters
messageNameThis represents the uORB message name; This message name should be globally unique.
Returns
0 = success; This means the messages is successfully sent to the receiver Note: This does not necessarily mean that the receiver as received it. otherwise = failure.

Implements uORBCommunicator::IChannel.

Definition at line 98 of file uORBKraitFastRpcChannel.cpp.

References _KraitWrapper, and px4muorb::KraitRpcWrapper::RemoveSubscriber().

Referenced by isInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_message()

int16_t uORB::KraitFastRpcChannel::send_message ( const char *  messageName,
int32_t  length,
uint8_t *  data 
)
virtual

Sends the data message over the communication link.

Parameters
messageNameThis represents the uORB message name; This message name should be globally unique.
lengthThe length of the data buffer to be sent.
dataThe actual data to be sent.
Returns
0 = success; This means the messages is successfully sent to the receiver Note: This does not mean that the receiver as received it. otherwise = failure.

Implements uORBCommunicator::IChannel.

Definition at line 113 of file uORBKraitFastRpcChannel.cpp.

References _AdspSubscriberCache, _AdspSubscriberSampleTimestamp, _KraitWrapper, _log_check_interval, _log_check_time, _overall_snd_avg, _overall_snd_count, _overall_snd_max, _overall_snd_min, _snd_msg_avg, _snd_msg_count, _snd_msg_max, _snd_msg_min, _SubCacheRefreshRate, hrt_absolute_time(), hrt_abstime, px4muorb::KraitRpcWrapper::IsSubscriberPresent(), px4muorb::KraitRpcWrapper::SendData(), status, t1, t2, t3, and t4.

Referenced by isInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Start()

void uORB::KraitFastRpcChannel::Start ( )

Definition at line 187 of file uORBKraitFastRpcChannel.cpp.

References _RecvThread, _ThreadShouldExit, _ThreadStarted, and thread_start().

Referenced by isInstance(), and muorb_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stop()

void uORB::KraitFastRpcChannel::Stop ( )

Definition at line 211 of file uORBKraitFastRpcChannel.cpp.

References _KraitWrapper, _RecvThread, _ThreadShouldExit, _ThreadStarted, and px4muorb::KraitRpcWrapper::UnblockReceiveData().

Referenced by isInstance(), and muorb_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread_start()

void * uORB::KraitFastRpcChannel::thread_start ( void *  handler)
staticprivate

Definition at line 221 of file uORBKraitFastRpcChannel.cpp.

Referenced by Start().

Here is the caller graph for this function:

◆ topic_advertised()

int16_t uORB::KraitFastRpcChannel::topic_advertised ( const char *  messageName)
virtual

Interface to notify the remote entity of a topic being advertised.

Parameters
messageNameThis represents the uORB message name(aka topic); This message name should be globally unique.
Returns
0 = success; This means the messages is successfully sent to the receiver Note: This does not mean that the receiver as received it. otherwise = failure.

Implements uORBCommunicator::IChannel.

Definition at line 71 of file uORBKraitFastRpcChannel.cpp.

References _KraitWrapper, and px4muorb::KraitRpcWrapper::TopicAdvertised().

Referenced by isInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ topic_unadvertised()

int16_t uORB::KraitFastRpcChannel::topic_unadvertised ( const char *  messageName)
virtual

Interface to notify the remote entity of a topic being unadvertised and is no longer publishing messages.

Parameters
messageNameThis represents the uORB message name(aka topic); This message name should be globally unique.
Returns
0 = success; This means the messages is successfully sent to the receiver Note: This does not mean that the receiver as received it. otherwise = failure.

Definition at line 80 of file uORBKraitFastRpcChannel.cpp.

References _KraitWrapper, and px4muorb::KraitRpcWrapper::TopicUnadvertised().

Referenced by isInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _AdspSubscriberCache

std::map<std::string, int32_t> uORB::KraitFastRpcChannel::_AdspSubscriberCache
private

Definition at line 181 of file uORBKraitFastRpcChannel.hpp.

Referenced by send_message().

◆ _AdspSubscriberSampleTimestamp

std::map<std::string, hrt_abstime> uORB::KraitFastRpcChannel::_AdspSubscriberSampleTimestamp
private

Definition at line 182 of file uORBKraitFastRpcChannel.hpp.

Referenced by send_message().

◆ _CONTROL_MSG_TYPE_ADD_SUBSCRIBER

const int32_t uORB::KraitFastRpcChannel::_CONTROL_MSG_TYPE_ADD_SUBSCRIBER = 1
staticprivate

Definition at line 167 of file uORBKraitFastRpcChannel.hpp.

◆ _CONTROL_MSG_TYPE_ADVERTISE

const int32_t uORB::KraitFastRpcChannel::_CONTROL_MSG_TYPE_ADVERTISE = 4
staticprivate

Definition at line 170 of file uORBKraitFastRpcChannel.hpp.

Referenced by fastrpc_recv_thread().

◆ _CONTROL_MSG_TYPE_REMOVE_SUBSCRIBER

const int32_t uORB::KraitFastRpcChannel::_CONTROL_MSG_TYPE_REMOVE_SUBSCRIBER = 2
staticprivate

Definition at line 168 of file uORBKraitFastRpcChannel.hpp.

◆ _CONTROL_MSG_TYPE_UNADVERTISE

const int32_t uORB::KraitFastRpcChannel::_CONTROL_MSG_TYPE_UNADVERTISE = 5
staticprivate

Definition at line 171 of file uORBKraitFastRpcChannel.hpp.

Referenced by fastrpc_recv_thread().

◆ _DATA_MSG_TYPE

const int32_t uORB::KraitFastRpcChannel::_DATA_MSG_TYPE = 3
staticprivate

Definition at line 169 of file uORBKraitFastRpcChannel.hpp.

Referenced by fastrpc_recv_thread().

◆ _InstancePtr

uORB::KraitFastRpcChannel * uORB::KraitFastRpcChannel::_InstancePtr = nullptr
staticprivate

Definition at line 161 of file uORBKraitFastRpcChannel.hpp.

Referenced by GetInstance(), and isInstance().

◆ _KraitWrapper

◆ _RecvThread

pthread_t uORB::KraitFastRpcChannel::_RecvThread
private

Definition at line 163 of file uORBKraitFastRpcChannel.hpp.

Referenced by Start(), and Stop().

◆ _RxHandler

uORBCommunicator::IChannelRxHandler* uORB::KraitFastRpcChannel::_RxHandler
private

Definition at line 162 of file uORBKraitFastRpcChannel.hpp.

Referenced by fastrpc_recv_thread(), and register_handler().

◆ _SubCacheRefreshRate

const hrt_abstime uORB::KraitFastRpcChannel::_SubCacheRefreshRate = 1000000
staticprivate

Definition at line 184 of file uORBKraitFastRpcChannel.hpp.

Referenced by send_message().

◆ _ThreadShouldExit

bool uORB::KraitFastRpcChannel::_ThreadShouldExit
private

Definition at line 165 of file uORBKraitFastRpcChannel.hpp.

Referenced by fastrpc_recv_thread(), Start(), and Stop().

◆ _ThreadStarted

bool uORB::KraitFastRpcChannel::_ThreadStarted
private

Definition at line 164 of file uORBKraitFastRpcChannel.hpp.

Referenced by Start(), and Stop().


The documentation for this class was generated from the following files: