UAV Core
The header file for PSDK Core related functionalities is uav_core.h
. This document outlines the key information and usage of the structures and function prototypes in the uav_core.h
file.
Table of Contents
Macro Definitions, Enumerations, and Structures
T_UAVUserInfoFunction Prototypes
UAV_Core_Init
UAV_Core_SetAlias
UAV_Core_SetFirmwareVersion
UAV_Core_ApplicationStart
UAV_Core_DeInit
Macro Definitions, Enumerations, and Structures
typedef struct T_UAVUserInfo
This structure is used to describe the payload information based on PSDK development.
Note:
- Please ensure that the Name, ID, and Key match the information on the developer website. For more details, please refer to the user center.
typedef struct {
char appName[32]; /*!< Specifies autelrobotics SDK app name. This info can be obtained by logging in to the
developer website https://developer.autelrobotics.com/user/apps/#all. End with '\0'. */
char appId[16]; /*!< Specifies autelrobotics SDK app ID. This info can be obtained by logging in to the
developer website https://developer.autelrobotics.com/user/apps/#all. */
char appKey[32]; /*!< Specifies autelrobotics SDK app key. This info can be obtained by logging in to the
developer website https://developer.autelrobotics.com/user/apps/#all. */
char appLicense[512]; /*!< Specifies autelrobotics SDK app license. This info can be obtained by logging in to the
developer website https://developer.autelrobotics.com/user/apps/#all. */
char developerAccount[64]; /*!< Specifies autelrobotics SDK developer account email. This info can be obtained by
logging in to the developer website https://developer.autelrobotics.com/user/apps/#all.
Developer's account and other related information need to be able to correspond.
End with '\0'. */
char baudRate[7]; /*!< Specify the autel SDK to communicate the port rate.*/
} T_UAVUserInfo;
Function Prototypes
function UAV_Core_Init
- Function: Initialize the Payload SDK core.
- product: all
Initialize the Payload SDK core in blocking mode.
Note:
- Special attention is required when calling this interface. It must be invoked after the console/OSAL handler functions or HAL handler functions are registered. Additionally, initialization must begin before invoking any other functional module interfaces. Ensure that developer information is correctly filled in to guarantee successful initialization. For further details, please refer to the PSDK Initialization tutorial.
- This function will not return until the correct drone type and PSDK adapter type are obtained. This logic ensures that both the drone and PSDK adapter are properly started before the PSDK functionality modules and user programs run. The typical execution time for this function is 2 to 4 seconds.
T_UAVReturnCode UAV_Core_Init(const T_UAVUserInfo *userInfo);
- ParametersuserInfo:A pointer to the PSDK application information.
- Return Value Returns the corresponding value based on the program execution status. For details, please refer to: UAV Error Codes.
function UAV_Core_SetAlias
- Function: Set a valid alias for the UAV application or product.
- product: all
Note:
- The correct App name obtained from the developer website must still be passed to the
UAV_Core_Init()
interface. The App name will be used for binding or verification. - This function will not return until the correct drone type and PSDK adapter type are obtained. This logic ensures that both the drone and PSDK adapter are properly started before the PSDK functionality modules and user programs run. The typical execution time for this function is 2 to 4 seconds.
- The correct App name obtained from the developer website must still be passed to the
T_UAVReturnCode UAV_Core_SetAlias(const char *productAlias);
- ParametersproductAlias:A pointer to the product alias string, which must be null-terminated (`'\0'`). The maximum length of the string is 31 characters. If the alias string exceeds 31 characters, it will be truncated before being passed in.
- Return Value Returns the corresponding value based on the program execution status. For details, please refer to: UAV Error Codes.
function UAV_Core_SetFirmwareVersion
- Function: Set a custom firmware version for the application or product.
- product: all
Note:
- The payload firmware version will always be displayed on the payload settings interface.
T_UAVReturnCode UAV_Core_SetFirmwareVersion(T_UAVFirmwareVersion version);
- Parametersversion:The custom firmware version to be set.Return Value Returns the corresponding value based on the program execution status. For details, please refer to: [UAV Error Codes](../100/3).
function UAV_Core_ApplicationStart
- Function: Notify the Payload SDK core that the application has started.
- product: all
Note:
- Special attention is required when calling this interface. It must be invoked after all module initialization and registration interfaces have been completed.
T_UAVReturnCode UAV_Core_ApplicationStart(void);
- Parametersnone:
- Return Value Returns the corresponding value based on the program execution status. For details, please refer to: UAV Error Codes.
function UAV_Core_DeInit
- Function: Deinitialize Payload SDK Core in blocking mode.
- product: all
T_UAVReturnCode UAV_Core_DeInit(void);
- Parameternone:
- Return Value Outputs the corresponding return value based on the program execution, for details please refer to: UAV Error Codes.