Public Member Functions
DJI::onboardSDK::HardDriver Class Reference

#include <DJI_HardDriver.h>

List of all members.

Public Member Functions

virtual void displayLog (const char *buf=0)
virtual void freeACK ()=0
virtual void freeMemory ()=0
virtual void freeMSG ()=0
virtual void freeNonBlockCBAck ()
virtual void freeProtocolHeader ()
virtual bool getDeviceStatus ()
virtual time_ms getTimeStamp ()=0
 HardDriver ()
virtual void init ()=0
 After calling this function, HardDriver should be able to read and send correctly, through a correct UART part.
virtual void lockACK ()=0
virtual void lockMemory ()=0
virtual void lockMSG ()=0
virtual void lockNonBlockCBAck ()
virtual void lockProtocolHeader ()
virtual void nonBlockWait ()
virtual void notify ()=0
virtual void notifyNonBlockCBAckRecv ()
virtual size_t readall (uint8_t *buf, size_t maxlen)=0
virtual size_t send (const uint8_t *buf, size_t len)=0
virtual void wait (int timeout)=0

Detailed Description

Definition at line 24 of file DJI_HardDriver.h.


Constructor & Destructor Documentation

Definition at line 27 of file DJI_HardDriver.h.


Member Function Documentation

void HardDriver::displayLog ( const char *  buf = 0) [virtual]

Definition at line 18 of file DJI_HardDriver.cpp.

virtual void DJI::onboardSDK::HardDriver::freeACK ( ) [pure virtual]
virtual void DJI::onboardSDK::HardDriver::freeMemory ( ) [pure virtual]
virtual void DJI::onboardSDK::HardDriver::freeMSG ( ) [pure virtual]
virtual void DJI::onboardSDK::HardDriver::freeNonBlockCBAck ( ) [inline, virtual]

Definition at line 104 of file DJI_HardDriver.h.

virtual void DJI::onboardSDK::HardDriver::freeProtocolHeader ( ) [inline, virtual]

Definition at line 101 of file DJI_HardDriver.h.

virtual bool DJI::onboardSDK::HardDriver::getDeviceStatus ( ) [inline, virtual]

Definition at line 85 of file DJI_HardDriver.h.

virtual void DJI::onboardSDK::HardDriver::init ( ) [pure virtual]

After calling this function, HardDriver should be able to read and send correctly, through a correct UART part.

Note:
How to use In order to provide platform crossable DJI onboardSDK library, we abstract this class as a hardware level.
function descriptions:

void init(); unsigned int getTimeStamp(); returns a TimeStamp data in unit msec. The difference between the return value of the function call two times is the excat time between them in msec.

size_t send(const uint8_t *buf, size_t len); return sent data length.

size_t readall(uint8_t *buf, size_t maxlen) = 0; return read data length.

void lockMemory();/ void freeMemory(); provide a mutex for multi-thread. when operating memory.

void lockMSG();/ void freeMSG(); provide a mutex for multi-thread. when operating messages.

void notify();/ void wait(); use conditional variable to signal controller thread about arrival of ACK frame.

void displayLog(char *buf); Micro "API_LOG" invoked this function, to pass datalog. In order to pass data through different stream or channel. We abstract this virtual function for user. And different from others, this interface is not a pure virtual funcion. The default data-passing channel is stdout (printf). See also "DJI_HardDriver.cpp".

Attention:
when writting and reading data, there might have multi-thread problems. Abstract class HardDriver did not consider these issue. Please be careful when you are going to implement send and readall funtions.
Note:
we strongly suggest you to inherit this class in your own file, not just implement it in DJI_HardDriver.cpp or inside this class
virtual void DJI::onboardSDK::HardDriver::lockACK ( ) [pure virtual]
virtual void DJI::onboardSDK::HardDriver::lockMemory ( ) [pure virtual]
virtual void DJI::onboardSDK::HardDriver::lockMSG ( ) [pure virtual]
virtual void DJI::onboardSDK::HardDriver::lockNonBlockCBAck ( ) [inline, virtual]

Definition at line 103 of file DJI_HardDriver.h.

virtual void DJI::onboardSDK::HardDriver::lockProtocolHeader ( ) [inline, virtual]

Definition at line 100 of file DJI_HardDriver.h.

virtual void DJI::onboardSDK::HardDriver::nonBlockWait ( ) [inline, virtual]

Definition at line 107 of file DJI_HardDriver.h.

virtual void DJI::onboardSDK::HardDriver::notify ( ) [pure virtual]
virtual void DJI::onboardSDK::HardDriver::notifyNonBlockCBAckRecv ( ) [inline, virtual]

Definition at line 106 of file DJI_HardDriver.h.

virtual size_t DJI::onboardSDK::HardDriver::readall ( uint8_t *  buf,
size_t  maxlen 
) [pure virtual]
virtual size_t DJI::onboardSDK::HardDriver::send ( const uint8_t *  buf,
size_t  len 
) [pure virtual]
virtual void DJI::onboardSDK::HardDriver::wait ( int  timeout) [pure virtual]

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


dji_sdk_lib
Author(s):
autogenerated on Thu Jun 6 2019 17:55:25