dji_subscription.hpp
Go to the documentation of this file.
void * UserData
This is used as the datatype for all data arguments in callbacks.
Definition: dji_type.hpp:75
void registerUserPackageUnpackCallback(int packageID, VehicleCallBack userFunctionAfterPackageExtraction, UserData userData=NULL)
Register a callback function after package[packageID] is received.
Definition: dji_subscription.cpp:181
DataSubscription(Vehicle *vehicle)
Definition: dji_subscription.cpp:99
This struct is returned from all blocking calls, except certain mission calls that have explicit type...
Definition: dji_ack.hpp:146
void removeAllExistingPackages()
Remove all occupied packages.
Definition: dji_subscription.cpp:495
Type definition for new Vehicle-style callbacks.
void removeLeftOverPackages()
Remove leftover incoming telemetry data due to unclean quit.
Definition: dji_subscription.cpp:472
void(* VehicleCallBack)(Vehicle *vehicle, RecvContainer recvFrame, UserData userData)
Function prototype for all callback functions used in the OSDK.
Definition: dji_vehicle_callback.hpp:76
void packageAddSuccessHandler()
Helper function to do post processing when adding package is successful.
Definition: dji_subscription.cpp:776
Package class to support Subscribe-style telemetry.
Definition: dji_subscription.hpp:60
int serializePackageInfo(uint8_t *buffer)
Serialize the info and uidList to a buffer to send to FC.
Definition: dji_subscription.cpp:713
TopicName
enum TopicName is the interface for user to create packages and access data It is also used as index ...
Definition: dji_telemetry.hpp:59
Telemetry API through asynchronous "Subscribe"-style messages.
Definition: dji_subscription.hpp:180
static void decodeCallback(Vehicle *vehiclePtr, RecvContainer rcvContainer, UserData subscriptionPtr)
This callback function is called by recvReqData, case CMD_ID_SUBSCRIBE.
Definition: dji_subscription.cpp:131
bool setTopicList(Telemetry::TopicName *topics, int numberOfTopics, uint16_t freq)
Fill in necessary information for ADD_PACKAGE call.
Definition: dji_subscription.cpp:627
void packageRemoveSuccessHandler()
Helper function to do post processing when removing package is successful.
Definition: dji_subscription.cpp:793
bool initPackageFromTopicList(int packageID, int numberOfTopics, Telemetry::TopicName *topicList, bool sendTimeStamp, uint16_t freq)
This is the interface for the end user to generate a package for subscription.
Definition: dji_subscription.cpp:166
The CallBackHandler struct allows users to encapsulate callbacks and data in one struct.
Definition: dji_vehicle_callback.hpp:83
Enumeration of all telemetry data types, structures and maps.
static void verifyCallback(Vehicle *vehiclePtr, RecvContainer rcvContainer, UserData userData)
Callback function for non-blocking verify()
Definition: dji_subscription.cpp:214
void verify()
Non-blocking call for version match.
Definition: dji_subscription.cpp:202
Definition: dji_ack.cpp:38
void removePackage(int packageID)
Non-blocking call for start package.
Definition: dji_subscription.cpp:406
void startPackage(int packageID)
Non-blocking call for starting a package.
Definition: dji_subscription.cpp:255
void reset()
Non-blocking call for resetting all packages.
Definition: dji_subscription.cpp:511