DJI Core

2024-04-02
4 Ratings
1 customer rated

The header file of PSDK Core related functions is dji_core.h. This document describes the key information and usage of the structure and function prototypes in the dji_core.h file.

Catalog

Enum

Struct

T_DjiUserInfo

Function

DjiCore_Init
DjiCore_SetAlias
DjiCore_SetFirmwareVersion
DjiCore_SetSerialNumber
DjiCore_ApplicationStart
DjiCore_DeInit

Definition, Enum and Struct

Struct T_DjiUserInfo

typedef struct {
char appName[32]; /*!< Specifies DJI SDK app name. This info can be obtained by logging in to the
developer website https://developer.dji.com/user/apps/#all. End with '\0'. */
char appId[16]; /*!< Specifies DJI SDK app ID. This info can be obtained by logging in to the
developer website https://developer.dji.com/user/apps/#all. */
char appKey[32]; /*!< Specifies DJI SDK app key. This info can be obtained by logging in to the
developer website https://developer.dji.com/user/apps/#all. */
char appLicense[512]; /*!< Specifies DJI SDK app license. This info can be obtained by logging in to the
developer website https://developer.dji.com/user/apps/#all. */
char developerAccount[64]; /*!< Specifies DJI SDK developer account email. This info can be obtained by
logging in to the developer website https://developer.dji.com/user/apps/#all.
Developer's account and other related information need to be able to correspond.
End with '\0'. */
char baudRate[7]; /*!< Specifies DJI SDK communication serial port baud rate. */
} T_DjiUserInfo;

Function

Function DjiCore_Init

Initialize the Payload SDK core in blocking mode.

Note: The order of calling this call is crucial. It must be done after registering console/OSAL/HAL handler functions It must be done after registering console/OSAL/HAL handler functions and before using other functional module interfaces. Correctly fill in the developer information to ensure successful initialization. See the See the "PSDK Initialization" tutorial for more. This function does not return until the correct aircraft type and PSDK adapter type is obtained. The logic ensures that aircraft and PSDK adapter have been started up normally before PSDK functional module and user's program run. General execution time of this function is 2-4 seconds.

T_DjiReturnCode DjiCore_Init(const T_DjiUserInfo *userInfo);
Parameter
userInfo:pointer to the PSDK application information.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiCore_SetAlias

Sets an alias for a DJI application or product that meets the condition for DJI application or product. If an alias exists, it will be displayed in DJI Pilot.

Note: Still need to pass in correct DJI APP name that is obtained from DJI SDK developer website to DjiCore_Init() interface. The DJI APP name will be used to bind and verification. The alias will take effect after a short delay, up to a maximum of 1 second.

T_DjiReturnCode DjiCore_SetAlias(const char *productAlias);
Parameter
productAlias:A pointer to the product alias string, which must end with '\0'. The maximum length of the string is 31 characters.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiCore_SetFirmwareVersion

Set custom firmware version for DJI application or product.

Note: Payload firmware version will always display in DJI Pilot payload settings interface.

T_DjiReturnCode DjiCore_SetFirmwareVersion(T_DjiFirmwareVersion version);
Parameter
version:the custom firmware version to be set.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiCore_SetSerialNumber

Set custom serial number for DJI application or product.

Note: Payload custom serial number will always display in DJI Pilot payload settings interface.

T_DjiReturnCode DjiCore_SetSerialNumber(const char *productSerialNumber);
Parameter
productSerialNumber:the custom serial number to be set, needs to be no larger than 32 bytes.
Return
The details for the return code please refer to: DjiErrorCode

Function DjiCore_ApplicationStart

Notify that the Payload SDK core application starts.

Note: The order of calling this interface requires special attention, The call needs to be completed after all the module initialize and register interfaces.

T_DjiReturnCode DjiCore_ApplicationStart(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

Function DjiCore_DeInit

DeInitialize the Payload SDK core in blocking mode.

T_DjiReturnCode DjiCore_DeInit(void);
Parameter
Return
The details for the return code please refer to: DjiErrorCode

If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.