34 #ifndef _uORBKraitFastRpcChannel_hpp_ 35 #define _uORBKraitFastRpcChannel_hpp_ 40 #include "uORB/uORBCommunicator.hpp" 41 #include "px4muorb_KraitRpcWrapper.hpp" 47 class KraitFastRpcChannel;
58 if (_InstancePtr ==
nullptr) {
70 return (_InstancePtr !=
nullptr);
114 virtual int16_t
add_subscription(
const char *messageName, int32_t msgRateInHz);
154 virtual int16_t
send_message(
const char *messageName, int32_t length, uint8_t *data);
163 pthread_t _RecvThread;
165 bool _ThreadShouldExit;
167 static const int32_t _CONTROL_MSG_TYPE_ADD_SUBSCRIBER = 1;
168 static const int32_t _CONTROL_MSG_TYPE_REMOVE_SUBSCRIBER = 2;
169 static const int32_t _DATA_MSG_TYPE = 3;
170 static const int32_t _CONTROL_MSG_TYPE_ADVERTISE = 4;
171 static const int32_t _CONTROL_MSG_TYPE_UNADVERTISE = 5;
173 struct BulkTransferHeader {
175 uint16_t _MsgNameLen;
181 std::map<std::string, int32_t> _AdspSubscriberCache;
182 std::map<std::string, hrt_abstime> _AdspSubscriberSampleTimestamp;
184 static const hrt_abstime _SubCacheRefreshRate = 1000000;
190 static void *thread_start(
void *handler);
192 void fastrpc_recv_thread();
virtual int16_t topic_unadvertised(const char *messageName)
Interface to notify the remote entity of a topic being unadvertised and is no longer publishing messa...
Definition: uORBKraitFastRpcChannel.cpp:80
virtual int16_t send_message(const char *messageName, int32_t length, uint8_t *data)
Sends the data message over the communication link.
Definition: uORBKraitFastRpcChannel.cpp:113
Definition: uORBKraitFastRpcChannel.hpp:50
virtual int16_t topic_advertised(const char *messageName)
Interface to notify the remote entity of a topic being advertised.
Definition: uORBKraitFastRpcChannel.cpp:71
Definition: uORBFastRpcChannel.hpp:44
High-resolution timer with callouts and timekeeping.
Definition: px4muorb_KraitRpcWrapper.hpp:42
Interface to enable remote subscriptions.
Definition: uORBCommunicator.hpp:51
Class passed to the communication link implement to provide callback for received messages over a cha...
Definition: uORBCommunicator.hpp:153
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Definition: drv_hrt.h:58
static uORB::KraitFastRpcChannel * GetInstance()
static method to get the IChannel Implementor.
Definition: uORBKraitFastRpcChannel.hpp:56
virtual int16_t register_handler(uORBCommunicator::IChannelRxHandler *handler)
Register Message Handler.
Definition: uORBKraitFastRpcChannel.cpp:107
virtual int16_t remove_subscription(const char *messageName)
Interface to notify the remote entity of removal of a subscription.
Definition: uORBKraitFastRpcChannel.cpp:98
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.
Definition: uORBKraitFastRpcChannel.cpp:89
static bool isInstance()
Static method to check if there is an instance.
Definition: uORBKraitFastRpcChannel.hpp:68