Onboard-SDK-ROS
|
Public Member Functions | |
virtual void | init ()=0 |
After calling this function, HardDriver should be able to read and send correctly, through a correct UART part. More... | |
virtual time_ms | getTimeStamp ()=0 |
virtual size_t | send (const uint8_t *buf, size_t len)=0 |
virtual size_t | readall (uint8_t *buf, size_t maxlen)=0 |
virtual void | lockMemory ()=0 |
virtual void | freeMemory ()=0 |
virtual void | lockMSG ()=0 |
virtual void | freeMSG ()=0 |
virtual void | displayLog (const char *buf=0) |
|
pure virtual |
After calling this function, HardDriver should be able to read and send correctly, through a correct UART part.
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 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".