PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <uORBKraitFastRpcChannel.hpp>
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::KraitFastRpcChannel * | GetInstance () |
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 |
Definition at line 50 of file uORBKraitFastRpcChannel.hpp.
|
private |
constructor.
Definition at line 63 of file uORBKraitFastRpcChannel.cpp.
References _KraitWrapper, and px4muorb::KraitRpcWrapper::Initialize().
|
virtual |
Interface to notify the remote entity of interest of a subscription for a message.
messageName | This represents the uORB message name; This message name should be globally unique. |
msgRate | The max rate at which the subscriber can accept the messages. |
Implements uORBCommunicator::IChannel.
Definition at line 89 of file uORBKraitFastRpcChannel.cpp.
References _KraitWrapper, and px4muorb::KraitRpcWrapper::AddSubscriber().
Referenced by isInstance().
|
private |
Definition at line 230 of file uORBKraitFastRpcChannel.cpp.
References _CONTROL_MSG_TYPE_ADVERTISE, _CONTROL_MSG_TYPE_UNADVERTISE, _DATA_MSG_TYPE, uORB::KraitFastRpcChannel::BulkTransferHeader::_DataLen, _KraitWrapper, uORB::KraitFastRpcChannel::BulkTransferHeader::_MsgNameLen, uORB::KraitFastRpcChannel::BulkTransferHeader::_MsgType, _RxHandler, _ThreadShouldExit, data, DumpData(), hrt_absolute_time(), hrt_abstime, uORBCommunicator::IChannelRxHandler::process_received_message(), uORBCommunicator::IChannelRxHandler::process_remote_topic(), px4muorb::KraitRpcWrapper::ReceiveBulkData(), t1, t2, and t3.
|
inlinestatic |
static method to get the IChannel Implementor.
Definition at line 56 of file uORBKraitFastRpcChannel.hpp.
References _InstancePtr.
Referenced by muorb_main().
|
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().
|
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().
|
virtual |
Interface to notify the remote entity of removal of a subscription.
messageName | This represents the uORB message name; This message name should be globally unique. |
Implements uORBCommunicator::IChannel.
Definition at line 98 of file uORBKraitFastRpcChannel.cpp.
References _KraitWrapper, and px4muorb::KraitRpcWrapper::RemoveSubscriber().
Referenced by isInstance().
|
virtual |
Sends the data message over the communication link.
messageName | This represents the uORB message name; This message name should be globally unique. |
length | The length of the data buffer to be sent. |
data | The actual data to be sent. |
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().
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().
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().
|
staticprivate |
Definition at line 221 of file uORBKraitFastRpcChannel.cpp.
Referenced by Start().
|
virtual |
Interface to notify the remote entity of a topic being advertised.
messageName | This represents the uORB message name(aka topic); This message name should be globally unique. |
Implements uORBCommunicator::IChannel.
Definition at line 71 of file uORBKraitFastRpcChannel.cpp.
References _KraitWrapper, and px4muorb::KraitRpcWrapper::TopicAdvertised().
Referenced by isInstance().
|
virtual |
Interface to notify the remote entity of a topic being unadvertised and is no longer publishing messages.
messageName | This represents the uORB message name(aka topic); This message name should be globally unique. |
Definition at line 80 of file uORBKraitFastRpcChannel.cpp.
References _KraitWrapper, and px4muorb::KraitRpcWrapper::TopicUnadvertised().
Referenced by isInstance().
|
private |
Definition at line 181 of file uORBKraitFastRpcChannel.hpp.
Referenced by send_message().
|
private |
Definition at line 182 of file uORBKraitFastRpcChannel.hpp.
Referenced by send_message().
|
staticprivate |
Definition at line 167 of file uORBKraitFastRpcChannel.hpp.
|
staticprivate |
Definition at line 170 of file uORBKraitFastRpcChannel.hpp.
Referenced by fastrpc_recv_thread().
|
staticprivate |
Definition at line 168 of file uORBKraitFastRpcChannel.hpp.
|
staticprivate |
Definition at line 171 of file uORBKraitFastRpcChannel.hpp.
Referenced by fastrpc_recv_thread().
|
staticprivate |
Definition at line 169 of file uORBKraitFastRpcChannel.hpp.
Referenced by fastrpc_recv_thread().
|
staticprivate |
Definition at line 161 of file uORBKraitFastRpcChannel.hpp.
Referenced by GetInstance(), and isInstance().
|
private |
Definition at line 179 of file uORBKraitFastRpcChannel.hpp.
Referenced by add_subscription(), fastrpc_recv_thread(), KraitFastRpcChannel(), remove_subscription(), send_message(), Stop(), topic_advertised(), and topic_unadvertised().
|
private |
Definition at line 163 of file uORBKraitFastRpcChannel.hpp.
|
private |
Definition at line 162 of file uORBKraitFastRpcChannel.hpp.
Referenced by fastrpc_recv_thread(), and register_handler().
|
staticprivate |
Definition at line 184 of file uORBKraitFastRpcChannel.hpp.
Referenced by send_message().
|
private |
Definition at line 165 of file uORBKraitFastRpcChannel.hpp.
Referenced by fastrpc_recv_thread(), Start(), and Stop().
|
private |
Definition at line 164 of file uORBKraitFastRpcChannel.hpp.