Public Member Functions | Static Public Member Functions | Private Attributes
dji2mav::MavModule Class Reference

#include <mavModule.h>

Inheritance diagram for dji2mav::MavModule:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool activateSender (uint16_t gcsIdx)
 Activate sender of the specific GCS.
virtual void activelySend ()=0
 Handle the messages sending process for the module.
void clearBuf ()
 Clear buffer content.
bool employGcsSender (uint16_t gcsIdx)
 Employ a sender for the specific GCS.
int getGcsSenderIdx (uint16_t gcsIdx)
 Get sender index for specific GCS.
int getMasterGcsIdx ()
 Get the index of master GCS.
int getMasterGcsSenderIdx ()
 Get the sender index of master GCS.
uint8_t getMySysid ()
 Get the sysid of this device.
std::string getName ()
 Get the name of module.
const int * getSenderRecord ()
 Get the senderRecord array address.
 MavModule (MavHandler &handler, std::string name, uint16_t bufSize)
 Constructor for base MavModule class.
virtual void passivelyReceive (mavlink_message_t &msg)=0
 Handle the received messages process for the module.
bool pullMsg (mavlink_message_t &destMsg)
 Pull mavlink message from the buffer.
bool pushMsg (uint16_t gcsIdx, const mavlink_message_t &srcMsg)
 Push mavlink message to the buffer.
void receiveHelper (mavlink_message_t &msg)
 The helper of thread passively reveive.
bool run ()
 Run a thread for the module.
bool sendMsgToAll (mavlink_message_t &msg)
 Send message to all activated GCS.
bool sendMsgToGcs (uint16_t gcsIdx, mavlink_message_t &msg)
 Send message to specific GCS.
bool sendMsgToMaster (mavlink_message_t &msg)
 Send message to master GCS.
bool sendMsgToSys (uint8_t sysid, mavlink_message_t &msg)
 Send message to corresponding GCS with sysid.
bool setMasterGcsIdx (uint16_t gcsIdx)
 Set the master GCS with its index.
virtual ~MavModule ()

Static Public Member Functions

static void * thread_call (void *param)
 A thread calling function for the module.

Private Attributes

MavHandlerm_hdlr
int m_masterGcsIdx
uint8_t m_masterSysid
ModuleBufm_moduleBuf
std::string m_name
int * m_senderRecord
pthread_t m_tid

Detailed Description

Definition at line 24 of file mavModule.h.


Constructor & Destructor Documentation

dji2mav::MavModule::MavModule ( MavHandler handler,
std::string  name,
uint16_t  bufSize 
) [inline]

Constructor for base MavModule class.

Parameters:
handler: The reference of MavHandler Object
name: The string name of this module
buf: The buffer size of received message

Definition at line 33 of file mavModule.h.

virtual dji2mav::MavModule::~MavModule ( ) [inline, virtual]

Definition at line 54 of file mavModule.h.


Member Function Documentation

bool dji2mav::MavModule::activateSender ( uint16_t  gcsIdx) [inline]

Activate sender of the specific GCS.

Parameters:
gcsIdx: The index of GCS
Returns:
True if succeed or false if fail

Definition at line 170 of file mavModule.h.

virtual void dji2mav::MavModule::activelySend ( ) [pure virtual]

Handle the messages sending process for the module.

Implemented in dji2mav::MavSensors, dji2mav::MavHeartbeat, dji2mav::MavHotpoint, and dji2mav::MavWaypoint.

void dji2mav::MavModule::clearBuf ( ) [inline]

Clear buffer content.

Definition at line 300 of file mavModule.h.

bool dji2mav::MavModule::employGcsSender ( uint16_t  gcsIdx) [inline]

Employ a sender for the specific GCS.

Parameters:
gcsIdx: The index of GCS
Returns:
True if succeed or false if fail

Definition at line 153 of file mavModule.h.

int dji2mav::MavModule::getGcsSenderIdx ( uint16_t  gcsIdx) [inline]

Get sender index for specific GCS.

Parameters:
gcsIdx: The index of GCS
Returns:
The sender index of the GCS or -2 for invalid input

Definition at line 141 of file mavModule.h.

Get the index of master GCS.

Returns:
The index of master GCS

Definition at line 89 of file mavModule.h.

Get the sender index of master GCS.

Returns:
SenderIdx of master, -2 for no master or -1 for no sender

Definition at line 98 of file mavModule.h.

uint8_t dji2mav::MavModule::getMySysid ( ) [inline]

Get the sysid of this device.

Returns:
The sysid of this device

Definition at line 80 of file mavModule.h.

std::string dji2mav::MavModule::getName ( ) [inline]

Get the name of module.

Returns:
The name of module

Definition at line 71 of file mavModule.h.

const int* dji2mav::MavModule::getSenderRecord ( ) [inline]

Get the senderRecord array address.

Returns:
The address of senderRecord

Definition at line 131 of file mavModule.h.

virtual void dji2mav::MavModule::passivelyReceive ( mavlink_message_t msg) [pure virtual]

Handle the received messages process for the module.

Parameters:
msg: The reference of received message

Implemented in dji2mav::MavSensors, dji2mav::MavHeartbeat, dji2mav::MavHotpoint, and dji2mav::MavWaypoint.

bool dji2mav::MavModule::pullMsg ( mavlink_message_t destMsg) [inline]

Pull mavlink message from the buffer.

Parameters:
destMsg: The destination of message
Returns:
True if succeed or false if fail

Definition at line 289 of file mavModule.h.

bool dji2mav::MavModule::pushMsg ( uint16_t  gcsIdx,
const mavlink_message_t srcMsg 
) [inline]

Push mavlink message to the buffer.

Parameters:
srcMsg: The source of message
Returns:
True if succeed or false if fail

Definition at line 275 of file mavModule.h.

The helper of thread passively reveive.

Parameters:
msg: A reference of message type that is used to recv

Definition at line 339 of file mavModule.h.

bool dji2mav::MavModule::run ( ) [inline]

Run a thread for the module.

Returns:
True if succeed to create the thread or false if fail

Definition at line 309 of file mavModule.h.

Send message to all activated GCS.

Parameters:
msg: The reference of encoded mavlink message
Returns:
True if succeed or false if fail

Definition at line 251 of file mavModule.h.

bool dji2mav::MavModule::sendMsgToGcs ( uint16_t  gcsIdx,
mavlink_message_t msg 
) [inline]

Send message to specific GCS.

Parameters:
gcsIdx: The index of specific GCS
msg: The reference of encoded mavlink message
Returns:
True if succeed or false if fail

Definition at line 198 of file mavModule.h.

Send message to master GCS.

Parameters:
msg: The reference of encoded mavlink message
Returns:
True if succeed or false if fail

Definition at line 241 of file mavModule.h.

bool dji2mav::MavModule::sendMsgToSys ( uint8_t  sysid,
mavlink_message_t msg 
) [inline]

Send message to corresponding GCS with sysid.

Parameters:
sysid: The sysid of target device
msg: The reference of encoded mavlink message
Returns:
True if succeed or false if fail

Definition at line 223 of file mavModule.h.

bool dji2mav::MavModule::setMasterGcsIdx ( uint16_t  gcsIdx) [inline]

Set the master GCS with its index.

Parameters:
gcsIdx: The index of GCS that is to be set
Returns:
True if succeed or false if fail

Definition at line 111 of file mavModule.h.

static void* dji2mav::MavModule::thread_call ( void *  param) [inline, static]

A thread calling function for the module.

Parameters:
param: The pointer to the module object

Definition at line 324 of file mavModule.h.


Member Data Documentation

Definition at line 369 of file mavModule.h.

Definition at line 366 of file mavModule.h.

Definition at line 367 of file mavModule.h.

Definition at line 365 of file mavModule.h.

std::string dji2mav::MavModule::m_name [private]

Definition at line 372 of file mavModule.h.

Definition at line 364 of file mavModule.h.

pthread_t dji2mav::MavModule::m_tid [private]

Definition at line 371 of file mavModule.h.


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


dji_sdk_dji2mav
Author(s):
autogenerated on Thu Jun 6 2019 17:55:37