#include <msgManager.h>
Public Member Functions | |
bool | establish (std::string targetIP, uint16_t targetPort, uint16_t srcPort) |
Establish the UDP connection to the target. | |
uint16_t | getCurrSenderListSize () |
Get current sender list size. | |
uint16_t | getMaxSenderListSize () |
Get max sender list size. | |
uint8_t * | getRecvBuf () |
Get the buffer of receiver. | |
uint16_t | getRecvBufSize () |
Get the buffer size of receiver. | |
uint8_t * | getSendBuf (uint16_t idx) |
Get the buffer of a sender. | |
uint16_t | getSendBufSize (uint16_t idx) |
Get the buffer size of a sender. | |
bool | isValidSenderIdx (uint16_t senderIdx) |
Check if a sender index is valid senderIdx : The index of sender. | |
MsgManager (uint16_t senderListSize, uint16_t sendBufSize, uint16_t recvBufSize) | |
Constructor for MsgManager. | |
int | recv () |
Receive mavlink message. | |
int | registerSender (uint16_t bufSize) |
Register a message sender and get its index. | |
int | registerSender () |
Register a messager sender with default buf size. | |
int | send (uint16_t idx, int len) |
Send mavlink message. | |
~MsgManager () | |
Private Attributes | |
SocketComm * | m_comm |
uint16_t | m_currListSize |
uint16_t | m_defaultSendBufSize |
uint16_t | m_maxListSize |
MsgReceiver * | m_receiver |
std::mutex | m_registerMutex |
MsgSender ** | m_senderList |
Definition at line 23 of file msgManager.h.
dji2mav::MsgManager::MsgManager | ( | uint16_t | senderListSize, |
uint16_t | sendBufSize, | ||
uint16_t | recvBufSize | ||
) | [inline] |
Constructor for MsgManager.
senderListSize | : Used to allocate senders list |
sendBufSize | : Used to allocate buf for sender |
recvBufSize | : Used to allocate buf for receiver |
Definition at line 31 of file msgManager.h.
dji2mav::MsgManager::~MsgManager | ( | ) | [inline] |
Definition at line 57 of file msgManager.h.
bool dji2mav::MsgManager::establish | ( | std::string | targetIP, |
uint16_t | targetPort, | ||
uint16_t | srcPort | ||
) | [inline] |
Establish the UDP connection to the target.
targetIP | : The IP of target |
targetPort | : The connection port of target |
srcPort | : The connection port of source |
Definition at line 208 of file msgManager.h.
uint16_t dji2mav::MsgManager::getCurrSenderListSize | ( | ) | [inline] |
Get current sender list size.
Definition at line 232 of file msgManager.h.
uint16_t dji2mav::MsgManager::getMaxSenderListSize | ( | ) | [inline] |
Get max sender list size.
Definition at line 241 of file msgManager.h.
uint8_t* dji2mav::MsgManager::getRecvBuf | ( | ) | [inline] |
Get the buffer of receiver.
Definition at line 178 of file msgManager.h.
uint16_t dji2mav::MsgManager::getRecvBufSize | ( | ) | [inline] |
Get the buffer size of receiver.
Definition at line 187 of file msgManager.h.
uint8_t* dji2mav::MsgManager::getSendBuf | ( | uint16_t | idx | ) | [inline] |
Get the buffer of a sender.
idx | : The index of the sender |
Definition at line 132 of file msgManager.h.
uint16_t dji2mav::MsgManager::getSendBufSize | ( | uint16_t | idx | ) | [inline] |
Get the buffer size of a sender.
idx | : The index of the sender |
Definition at line 146 of file msgManager.h.
bool dji2mav::MsgManager::isValidSenderIdx | ( | uint16_t | senderIdx | ) | [inline] |
Check if a sender index is valid senderIdx : The index of sender.
Definition at line 86 of file msgManager.h.
int dji2mav::MsgManager::recv | ( | ) | [inline] |
Receive mavlink message.
Definition at line 196 of file msgManager.h.
int dji2mav::MsgManager::registerSender | ( | uint16_t | bufSize | ) | [inline] |
Register a message sender and get its index.
bufSize | : Set the buf size of sender. Default 1024 |
Definition at line 96 of file msgManager.h.
int dji2mav::MsgManager::registerSender | ( | ) | [inline] |
Register a messager sender with default buf size.
Definition at line 122 of file msgManager.h.
int dji2mav::MsgManager::send | ( | uint16_t | idx, |
int | len | ||
) | [inline] |
Send mavlink message.
idx | : The index of the sender |
len | : The length that should be sent |
Definition at line 161 of file msgManager.h.
SocketComm* dji2mav::MsgManager::m_comm [private] |
Definition at line 252 of file msgManager.h.
uint16_t dji2mav::MsgManager::m_currListSize [private] |
Definition at line 249 of file msgManager.h.
uint16_t dji2mav::MsgManager::m_defaultSendBufSize [private] |
Definition at line 250 of file msgManager.h.
uint16_t dji2mav::MsgManager::m_maxListSize [private] |
Definition at line 248 of file msgManager.h.
MsgReceiver* dji2mav::MsgManager::m_receiver [private] |
Definition at line 251 of file msgManager.h.
std::mutex dji2mav::MsgManager::m_registerMutex [private] |
Definition at line 254 of file msgManager.h.
MsgSender** dji2mav::MsgManager::m_senderList [private] |
Definition at line 247 of file msgManager.h.