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

#include <moduleBuf.h>

List of all members.

Public Member Functions

void clear ()
 Clear the buffer. Set used amount 0 but not head pointer.
void display ()
uint16_t getBufSize ()
 Get the max size of buffer.
uint16_t getBufUsedAmount ()
 Get the used amount of buffer.
 ModuleBuf (uint16_t bufSize)
bool readBuf (uint8_t *dest, uint16_t len)
 Read data from the buffer. Multi-thread supported.
bool writeBuf (const uint8_t *src, uint16_t len)
 Write data to the buffer. Multi-thread supported.
 ~ModuleBuf ()

Private Attributes

uint8_t * m_buf
std::mutex m_bufMutex
uint16_t m_bufSize
uint16_t m_bufUsedAmount
uint16_t m_head

Detailed Description

Definition at line 19 of file moduleBuf.h.


Constructor & Destructor Documentation

dji2mav::ModuleBuf::ModuleBuf ( uint16_t  bufSize) [inline]

Definition at line 21 of file moduleBuf.h.

Definition at line 43 of file moduleBuf.h.


Member Function Documentation

void dji2mav::ModuleBuf::clear ( ) [inline]

Clear the buffer. Set used amount 0 but not head pointer.

Definition at line 142 of file moduleBuf.h.

void dji2mav::ModuleBuf::display ( ) [inline]

Definition at line 128 of file moduleBuf.h.

uint16_t dji2mav::ModuleBuf::getBufSize ( ) [inline]

Get the max size of buffer.

Returns:
The max size of buffer

Definition at line 55 of file moduleBuf.h.

uint16_t dji2mav::ModuleBuf::getBufUsedAmount ( ) [inline]

Get the used amount of buffer.

Returns:
The used amount of buffer

Definition at line 64 of file moduleBuf.h.

bool dji2mav::ModuleBuf::readBuf ( uint8_t *  dest,
uint16_t  len 
) [inline]

Read data from the buffer. Multi-thread supported.

Parameters:
dest: The pointer to the destination memory
len: The length that is going to read from the buffer
Returns:
True if succeed or false if fail

Definition at line 103 of file moduleBuf.h.

bool dji2mav::ModuleBuf::writeBuf ( const uint8_t *  src,
uint16_t  len 
) [inline]

Write data to the buffer. Multi-thread supported.

Parameters:
src: The pointer to the source memory
len: The length that is going to write to the buffer
Returns:
True if succeed or false if fail

Definition at line 75 of file moduleBuf.h.


Member Data Documentation

uint8_t* dji2mav::ModuleBuf::m_buf [private]

Definition at line 154 of file moduleBuf.h.

std::mutex dji2mav::ModuleBuf::m_bufMutex [private]

Definition at line 158 of file moduleBuf.h.

uint16_t dji2mav::ModuleBuf::m_bufSize [private]

Definition at line 155 of file moduleBuf.h.

Definition at line 157 of file moduleBuf.h.

uint16_t dji2mav::ModuleBuf::m_head [private]

Definition at line 156 of file moduleBuf.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