dji_flight_link.hpp
Go to the documentation of this file.
1 
29 #ifndef DJI_CONTROL_LINK_HPP
30 #define DJI_CONTROL_LINK_HPP
31 #include "dji_vehicle_callback.hpp"
32 #include "osdk_command.h"
33 
34 namespace DJI {
35 namespace OSDK {
36 class FlightLink {
37  public:
38  FlightLink(Vehicle *vehicle);
39 
40  ~FlightLink();
41 
46  typedef struct callbackWarpperHandler {
47  void (*cb)(ErrorCode::ErrorCodeType retCode, UserData userData);
48  UserData udata;
50  typedef uint8_t retCodeType;
51 
52  void linkSendFCAsync(const uint8_t cmd[], const uint8_t *cmdData, size_t len,
53  Command_SendCallback func,
54  void (*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData),
55  void *userData, uint32_t timeOut, uint16_t retryTimes);
56 
57  E_OsdkStat linkSendFCSync(const uint8_t cmd[], const uint8_t *cmdData, size_t len,
58  uint8_t *ackData, uint32_t *ack_len, uint32_t timeOut, uint16_t retryTimes);
59 
72  void sendAsync(const uint8_t cmd[], void *pdata, size_t len, void *callBack,
73  UserData userData, int timeout = 500, int retryTime = 2);
84  void *sendSync(const uint8_t cmd[], void *pdata, size_t len, int timeout);
85 
86  void sendDirectly(const uint8_t cmd[], void *pdata, size_t len);
87  public:
88  Vehicle *getVehicle() const;
89 
90  void setVehicle(Vehicle *value);
91 
92  private:
93  Vehicle *vehicle;
94 
95 };
96 } // namespace OSDK
97 } // namespace DJI
98 
99 #endif // DJI_CONTROL_LINK_HPP
void * UserData
This is used as the datatype for all data arguments in callbacks.
Definition: dji_type.hpp:75
int64_t ErrorCodeType
Unified error type.
Definition: dji_error.hpp:144
Type definition for new Vehicle-style callbacks.
Definition: dji_ack.cpp:38