•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Search Results
DJI::OSDK::PSDKModule Class Reference
PSDK module. More...
#include <dji_psdk_module.hpp>
Inheritance diagram for DJI::OSDK::PSDKModule:
Classes | |
struct PSDKWidgetValuesData | |
Capturing PushData of PSDK widget values, CMD: 0x00, 0x07. More... | |
Public Types | |
enum FunctionID { FUNCTION_SET_PSDK_1_0_WIDGET_VALUE = 70 } | |
enum PayloadWidgetType { BUTTON = 1, SWITCH = 2, RANGE = 3, LIST = 4, INPUT = 5, UNKNOWN = 0xFF } | |
typedef struct DJI::OSDK::PSDKModule::PSDKWidgetInfo PSDKWidgetInfo | |
typedef struct DJI::OSDK::PSDKModule::PSDKWidgetReq PSDKWidgetReq | |
typedef struct DJI::OSDK::PSDKModule::PSDKWidgetRsp PSDKWidgetRsp | |
typedef struct DJI::OSDK::PSDKModule::PSDKWidgetValuesData PSDKWidgetValuesData | |
Capturing PushData of PSDK widget values, CMD: 0x00, 0x07. | |
typedef void(* PSDKWidgetValuesUserCallback) (std::vector< PSDKWidgetInfo > widgets, UserData userData) | |
typedef struct DJI::OSDK::PSDKModule::PSDKWidgetValuesUserHandler PSDKWidgetValuesUserHandler | |
typedef void(* PSDKCommunicationUserCallback) (uint8_t *dataBuf, uint16_t dataLen, UserData userData) | |
typedef struct DJI::OSDK::PSDKModule::PSDKCommonicationUserHandler PSDKCommonicationUserHandler | |
Public Member Functions | |
PSDKModule (PayloadLink *payloadLink, PayloadIndexType payloadIndex, std::string name, bool enable) | |
MopClient * getMopClient () | |
ErrorCode::ErrorCodeType configureWidgetValueSync (uint8_t widgetIndex, PayloadWidgetType widgetType, int widgetValue, int timeout) | |
Sample to configure the value, blocking. More... | |
void configureWidgetValueAsync (uint8_t widgetIndex, PayloadWidgetType widgetType, int widgetValue, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Sample to configure the value, non-blocking. More... | |
ErrorCode::ErrorCodeType subscribePSDKWidgetValues (PSDKWidgetValuesUserCallback cb, UserData userData) | |
Sample to set the callback for widget values, non-blocking. More... | |
ErrorCode::ErrorCodeType unsubscribeWidgetValues () | |
Sample to disable the callback for widget values, non-blocking. More... | |
VehicleCallBackHandler * getSubscribeWidgetValuesHandler () | |
used in internal to do suhscribing task for PSDK widget More... | |
ErrorCode::ErrorCodeType subscribePSDKCommonication (PSDKCommunicationUserCallback cb, UserData userData) | |
Sample to set the callback for PSDK commonication data, non-blocking. More... | |
ErrorCode::ErrorCodeType unsubscribePSDKCommonication () | |
Sample to disable the callback for PSDK commonication data, non-blocking. More... | |
VehicleCallBackHandler * getCommunicationHandler () | |
used in internal to do suhscribing task for PSDK commonication data More... | |
ErrorCode::ErrorCodeType sendDataToPSDK (uint8_t *data, uint16_t len) | |
sending data from OSDK to PSDK More... | |
![]() | |
PayloadBase (Linker *linker, PayloadIndexType index, std::string name, bool enable) | |
void setEnable (bool en) | |
set the enable status of this payload module More... | |
bool getEnable () | |
get the enable status of this payload module More... | |
PayloadIndexType getIndex () | |
std::string getName () | |
void setName (std::string name) | |
Linker * getLinker () | |
Static Public Attributes | |
static const uint8_t psdkWidgetMaxCount = 30 | |
static const uint16_t MAX_SIZE_OF_PACKAGE = 255 | |
Detailed Description
PSDK module.
Member Enumeration Documentation
◆ PayloadWidgetType
Member Function Documentation
◆ configureWidgetValueAsync()
void DJI::OSDK::PSDKModule::configureWidgetValueAsync | ( | uint8_t | widgetIndex, |
PayloadWidgetType | widgetType, | ||
int | widgetValue, | ||
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, | ||
UserData | userData | ||
) |
Sample to configure the value, non-blocking.
- Parameters
-
widgetIndex the index of target widget widgetType the type of target widget, ref to DJI::OSDK::PSDKModule::PayloadWidgetType widgetValue the value of target widget UserCallBack UserCallBack callback function defined by user userData when UserCallBack is called, used in UserCallBack
◆ configureWidgetValueSync()
ErrorCode::ErrorCodeType DJI::OSDK::PSDKModule::configureWidgetValueSync | ( | uint8_t | widgetIndex, |
PayloadWidgetType | widgetType, | ||
int | widgetValue, | ||
int | timeout | ||
) |
Sample to configure the value, blocking.
- Parameters
-
widgetIndex the index of target widget widgetType the type of target widget, ref to DJI::OSDK::PSDKModule::PayloadWidgetType widgetValue the value of target widget timeout timeout time in seconds to request
- Returns
- ErrorCode::ErrorCodeType error code
◆ getCommunicationHandler()
VehicleCallBackHandler* DJI::OSDK::PSDKModule::getCommunicationHandler | ( | ) |
used in internal to do suhscribing task for PSDK commonication data
- Returns
- handler including callback and userdata to do PSDK commonication data subscription related deocding.
◆ getMopClient()
MopClient* DJI::OSDK::PSDKModule::getMopClient | ( | ) |
@breif Get the object of the mop client of this psdk module
◆ getSubscribeWidgetValuesHandler()
VehicleCallBackHandler* DJI::OSDK::PSDKModule::getSubscribeWidgetValuesHandler | ( | ) |
used in internal to do suhscribing task for PSDK widget
- Returns
- handler including callback and userdata to do psdk widget subscription related deocding.
◆ sendDataToPSDK()
ErrorCode::ErrorCodeType DJI::OSDK::PSDKModule::sendDataToPSDK | ( | uint8_t * | data, |
uint16_t | len | ||
) |
sending data from OSDK to PSDK
- Parameters
-
data sent data len length of data
- Returns
- ErrorCode::ErrorCodeType error code
◆ subscribePSDKCommonication()
ErrorCode::ErrorCodeType DJI::OSDK::PSDKModule::subscribePSDKCommonication | ( | PSDKCommunicationUserCallback | cb, |
UserData | userData | ||
) |
Sample to set the callback for PSDK commonication data, non-blocking.
- Parameters
-
cb the callback to catch the communication data from PSDK. userData the userData to be called by cb
- Returns
- ErrorCode::ErrorCodeType error code
◆ subscribePSDKWidgetValues()
ErrorCode::ErrorCodeType DJI::OSDK::PSDKModule::subscribePSDKWidgetValues | ( | PSDKWidgetValuesUserCallback | cb, |
UserData | userData | ||
) |
Sample to set the callback for widget values, non-blocking.
- Note
- When the widget values of target PSDK device is pushing to OSDK, the callback will be called and catch the widget values.
- Parameters
-
cb the callback to catch the widget values pushging. userData the userData to be called by cb
- Returns
- ErrorCode::ErrorCodeType error code
◆ unsubscribePSDKCommonication()
ErrorCode::ErrorCodeType DJI::OSDK::PSDKModule::unsubscribePSDKCommonication | ( | ) |
Sample to disable the callback for PSDK commonication data, non-blocking.
- Returns
- ErrorCode::ErrorCodeType error code
◆ unsubscribeWidgetValues()
ErrorCode::ErrorCodeType DJI::OSDK::PSDKModule::unsubscribeWidgetValues | ( | ) |
Sample to disable the callback for widget values, non-blocking.
- Returns
- ErrorCode::ErrorCodeType error code
The documentation for this class was generated from the following file:
- osdk-core/modules/inc/payload/dji_psdk_module.hpp