Public Member Functions | Private Attributes
dji2mav::MavHeartbeat Class Reference

#include <mavHeartbeat.h>

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

List of all members.

Public Member Functions

void activelySend ()
 Implement the messages actively sending function.
 MavHeartbeat (MavHandler &handler, std::string name, uint16_t gcsNum,...)
 Constructor for Heartbeat Module. Recv buf size 4096.
void passivelyReceive (mavlink_message_t &msg)
 Implement the messages passively handling function.
void reactToHeartbeat (uint16_t gcsIdx, const mavlink_message_t *msg)
 React to heartbeat from specific GCS and execute hook.
bool sendHeartbeatToAll ()
 Send heartbeat to all GCS.
bool sendHeartbeatToGcs (uint16_t gcsIdx)
 Send heartbeat to specific GCS. Compid is set to ALL.
void setAutopilot (uint8_t mavAutopilot)
 Set autopilot.
void setBaseMode (uint8_t mavMode)
 Set base mode.
void setCustomMode (uint32_t customMode)
 Set custom mode.
void setHeartbeatData (uint8_t mavType, uint8_t mavAutopilot, uint8_t mavMode, uint32_t customMode, uint8_t mavStatus, uint8_t mavVersion)
 Set the heartbeat package raw data.
void setHeartbeatHook (void(*func)())
 Set the responser function pointer for the heartbeat.
void setMavlinkVersion (uint8_t mavVersion)
 Set mavlink version.
void setSystemStatus (uint8_t mavStatus)
 Set status.
void setType (uint8_t mavType)
 Set type.
 ~MavHeartbeat ()

Private Attributes

mavlink_heartbeat_t m_hbMsg
void(* m_hook )()
mavlink_message_t m_sendMsg

Detailed Description

Definition at line 23 of file mavHeartbeat.h.


Constructor & Destructor Documentation

dji2mav::MavHeartbeat::MavHeartbeat ( MavHandler handler,
std::string  name,
uint16_t  gcsNum,
  ... 
) [inline]

Constructor for Heartbeat Module. Recv buf size 4096.

Parameters:
handler: The reference of MavHandler Object
name: The name of this module
gcsNum: The number of GCS that the module employs
...: The indexes of GCS list, should be uint16_t

Definition at line 32 of file mavHeartbeat.h.

Definition at line 61 of file mavHeartbeat.h.


Member Function Documentation

void dji2mav::MavHeartbeat::activelySend ( ) [inline, virtual]

Implement the messages actively sending function.

Implements dji2mav::MavModule.

Definition at line 216 of file mavHeartbeat.h.

Implement the messages passively handling function.

Parameters:
msg: The reference of received message

Implements dji2mav::MavModule.

Definition at line 209 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::reactToHeartbeat ( uint16_t  gcsIdx,
const mavlink_message_t msg 
) [inline]

React to heartbeat from specific GCS and execute hook.

Parameters:
gcsIdx: Get the index of GCS
msg: Get the received message

Definition at line 189 of file mavHeartbeat.h.

Send heartbeat to all GCS.

Returns:
True if succeed or false if fail

Definition at line 169 of file mavHeartbeat.h.

bool dji2mav::MavHeartbeat::sendHeartbeatToGcs ( uint16_t  gcsIdx) [inline]

Send heartbeat to specific GCS. Compid is set to ALL.

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

Definition at line 150 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::setAutopilot ( uint8_t  mavAutopilot) [inline]

Set autopilot.

Parameters:
mavAutopilot: Default full supporting for everything

Definition at line 104 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::setBaseMode ( uint8_t  mavMode) [inline]

Set base mode.

Parameters:
mavMode: Default autocontrol and disarmed

Definition at line 113 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::setCustomMode ( uint32_t  customMode) [inline]

Set custom mode.

Parameters:
customMode: Default 0. Defined by user

Definition at line 122 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::setHeartbeatData ( uint8_t  mavType,
uint8_t  mavAutopilot,
uint8_t  mavMode,
uint32_t  customMode,
uint8_t  mavStatus,
uint8_t  mavVersion 
) [inline]

Set the heartbeat package raw data.

Parameters:
mavType: Default quadrotor type
mavAutopilot: Default full supporting for every
mavMode: Default autocontrol and disarmed
customMode: Default 0. Defined by user
mavStatus: Default vehicle grounded and standby
mavVersion: Default 3

Definition at line 76 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::setHeartbeatHook ( void(*)()  func) [inline]

Set the responser function pointer for the heartbeat.

Parameters:
Thefunction pointer that is to be set

Definition at line 200 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::setMavlinkVersion ( uint8_t  mavVersion) [inline]

Set mavlink version.

Parameters:
mavVersion: Default 3

Definition at line 140 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::setSystemStatus ( uint8_t  mavStatus) [inline]

Set status.

Parameters:
mavStatus: Default vehicle grounded and standby

Definition at line 131 of file mavHeartbeat.h.

void dji2mav::MavHeartbeat::setType ( uint8_t  mavType) [inline]

Set type.

Parameters:
mavType: Default quadrotor type

Definition at line 95 of file mavHeartbeat.h.


Member Data Documentation

Definition at line 224 of file mavHeartbeat.h.

void(* dji2mav::MavHeartbeat::m_hook)() [private]

Definition at line 226 of file mavHeartbeat.h.

Definition at line 223 of file mavHeartbeat.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