30 #ifndef ONBOARDSDK_INTERNAL_DJI_PROTOCOL_BASE_H 31 #define ONBOARDSDK_INTERNAL_DJI_PROTOCOL_BASE_H 51 #ifndef DJI_VEHICLECALLBACK_H 70 DJI::OSDK::ACK::Entry recvInfo;
71 DJI::OSDK::ACK::TypeUnion recvData;
80 virtual ~ProtocolBase();
84 virtual void init(HardDriver* Driver, MMU* mmuPtr,
85 bool userCallbackThread =
false) = 0;
95 virtual int sendInterface(
void* cmdContainer) = 0;
98 virtual int sendData(uint8_t* buf) = 0;
107 typedef struct SDKFilter
119 virtual bool readPoll();
123 virtual bool byteHandler(
const uint8_t in_data);
128 virtual bool streamHandler(uint8_t in_data);
132 virtual void storeData(uint8_t in_data);
136 virtual bool checkStream() = 0;
140 virtual bool verifyHead() = 0;
144 virtual bool verifyData() = 0;
148 virtual bool callApp() = 0;
152 virtual bool appHandler(
void* protocolHeader) = 0;
155 void prepareDataStream();
158 void shiftDataStream();
161 void reuseDataStream();
165 virtual int crcHeadCheck(uint8_t* pMsg,
size_t nLen) = 0;
167 virtual int crcTailCheck(uint8_t* pMsg,
size_t nLen) = 0;
172 HardDriver* getDriver()
const;
175 ThreadAbstract* getThreadHandle()
const;
177 void setDriver(HardDriver* hardDriver_ptr);
179 void setThreadHandle(ThreadAbstract* threadAbstract_ptr);
182 void setHeaderLength(uint8_t length);
185 void setMaxRecvLength(
int length);
196 HardDriver* deviceDriver;
200 ThreadAbstract* threadHandle;
219 bool is_large_data_protocol;
227 #endif // ONBOARDSDK_INTERNAL_DJI_PROTOCOL_BASE_H Serial device driver abstraction. Provided as an abstract class. Please inherit and implement for ind...
struct DJI::OSDK::RecvContainer RecvContainer
Received info.
Data protection and thread management abstract classes.
Dispatch info.
Definition: dji_vehicle_callback.hpp:48
Data type and Data Structure definitions for use throughout DJI OSDK.
Logging mechanism for printing status and error messages to the screen.
handle array of characters
Definition: commondatarangehandler.h:14
struct DJI::OSDK::DispatchInfo DispatchInfo
Dispatch info.
All DJI OSDK ACK parsing.