33 #ifndef _uORBFastRpcChannel_hpp_ 34 #define _uORBFastRpcChannel_hpp_ 40 #include <semaphore.h> 42 #include <px4_platform_common/sem.h> 101 virtual int16_t
add_subscription(
const char *messageName, int32_t msgRateInHz);
141 virtual int16_t
send_message(
const char *messageName, int32_t length, uint8_t *
data);
148 int32_t topic_name_len,
150 int32_t data_len_in_bytes,
151 int32_t *bytes_returned
154 int16_t
get_bulk_data(uint8_t *buffer, int32_t max_size_in_bytes, int32_t *returned_bytes, int32_t *topic_count);
228 sem_init(&_Sem, 0, 1);
255 sem_init(&_Sem, 0, 0);
257 px4_sem_setprotocol(&_Sem, SEM_PRIO_NONE);
295 int32_t
copy_msg_to_buffer(
bool isData, int32_t src_index, uint8_t *dst_buffer, int32_t offset, int32_t dst_buffer_len);
uORBCommunicator::IChannelRxHandler * GetRxHandler()
static const int32_t _MAX_MSG_QUEUE_SIZE
data structure to store the messages to be retrived by Krait.
static struct vehicle_status_s status
static const int32_t _PACKET_FIELD_TOPIC_NAME_LEN_SIZE_IN_BYTES
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.
Semaphore _DataAvailableSemaphore
FastRpcChannel()
constructor.
void AddRemoteSubscriber(const std::string &messageName)
static uORB::FastRpcChannel * GetInstance()
static method to get the IChannel Implementor.
struct FastRpcControlMsg _ControlMsgQueue[_MAX_MSG_QUEUE_SIZE]
virtual int16_t send_message(const char *messageName, int32_t length, uint8_t *data)
Sends the data message over the communication link.
void check_and_expand_data_buffer(int32_t index, int32_t length)
void RemoveRemoteSubscriber(const std::string &messageName)
struct FastRpcDataMsg _DataMsgQueue[_MAX_MSG_QUEUE_SIZE]
int16_t control_msg_queue_add(int32_t msgtype, const char *messageName)
static const int32_t _CONTROL_MSG_TYPE_ADD_SUBSCRIBER
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...
uORBCommunicator::IChannelRxHandler * _RxHandler
int32_t copy_msg_to_buffer(bool isData, int32_t src_index, uint8_t *dst_buffer, int32_t offset, int32_t dst_buffer_len)
int16_t is_subscriber_present(const char *messageName, int32_t *status)
static const int32_t _DATA_MSG_TYPE
static const int32_t _CONTROL_MSG_TYPE_ADVERTISE
int16_t get_bulk_data(uint8_t *buffer, int32_t max_size_in_bytes, int32_t *returned_bytes, int32_t *topic_count)
Class passed to the communication link implement to provide callback for received messages over a cha...
int32_t _ControlQOutIndex
static const int32_t _CONTROL_MSG_TYPE_UNADVERTISE
virtual int16_t remove_subscription(const char *messageName)
Interface to notify the remote entity of removal of a subscription.
std::list< std::string > _Subscribers
static uORB::FastRpcChannel _Instance
std::set< std::string > _RemoteSubscribers
virtual int16_t topic_advertised(const char *messageName)
Interface to notify the remote entity of a topic being advertised.
Interface to enable remote subscriptions.
static const int32_t _PACKET_HEADER_SIZE
int32_t get_msg_size_at(bool isData, int32_t index)
static const int32_t _PACKET_FIELD_DATA_LEN_IN_BYTES
virtual int16_t register_handler(uORBCommunicator::IChannelRxHandler *handler)
Register Message Handler.
int16_t unblock_get_data_method()
int16_t get_data(int32_t *msg_type, char *topic_name, int32_t topic_name_len, uint8_t *data, int32_t data_len_in_bytes, int32_t *bytes_returned)
static const int32_t _CONTROL_MSG_TYPE_REMOVE_SUBSCRIBER