自定义 HMS 功能

2024-11-14
暂无评分

目录

宏定义、枚举与结构体

E_DjiHmsErrorLevel
T_DjiHmsFileBinaryArray
T_DjiHmsBinaryArrayConfig

函数原型

DjiHmsCustomization_Init
DjiHmsCustomization_DeInit
DjiHmsCustomization_InjectHmsErrorCode
DjiHmsCustomization_EliminateHmsErrorCode
DjiHmsCustomization_RegDefaultHmsTextConfigByDirPath
DjiHmsCustomization_RegHmsTextConfigByDirPath
DjiHmsCustomization_RegDefaultHmsTextConfigByBinaryArray
DjiHmsCustomization_RegHmsTextConfigByBinaryArray

宏定义、枚举与结构体

Enum E_DjiHmsErrorLevel

typedef enum {
DJI_HMS_ERROR_LEVEL_NONE = 0,
DJI_HMS_ERROR_LEVEL_HINT,
DJI_HMS_ERROR_LEVEL_WARN,
DJI_HMS_ERROR_LEVEL_CRITICAL,
DJI_HMS_ERROR_LEVEL_FATAL,
} E_DjiHmsErrorLevel;

Struct T_DjiHmsFileBinaryArray

typedef struct {
char *fileName; /*!< 定义 HMS 文案配置文件名。*/
uint32_t fileSize; /*!< 定义 HMS 文案配置文件的大小。单位为 byte。 */
const uint8_t *fileBinaryArray; /*!< 定义 HMS 文案配置文件的 C 语言数组。*/
} T_DjiHmsFileBinaryArray;

Struct T_DjiHmsBinaryArrayConfig

typedef struct {
uint16_t binaryArrayCount; /*!< 二进制数组的元素计数。*/
T_DjiHmsFileBinaryArray *fileBinaryArrayList; /*!< 指向二进制数组列表的指针。*/
} T_DjiHmsBinaryArrayConfig;

函数原型

Function DjiHmsCustomization_Init

初始化自定义 HMS 功能模块。用户在使用自定义 HMS 功能模块之前应调用此函数。

T_DjiReturnCode DjiHmsCustomization_Init(void);
参数
返回值
返回值详情请参见:DjiErrorCode

Function DjiHmsCustomization_DeInit

去初始化自定义 HMS 功能。

T_DjiReturnCode DjiHmsCustomization_DeInit(void);
参数
返回值
返回值详情请参见:DjiErrorCode

Function DjiHmsCustomization_InjectHmsErrorCode

向应用程序上报自定义 HMS 错误码。

注意: 如需上报相同的 HMS 错误码,仅需调用一次接口,无需重复调用。

T_DjiReturnCode DjiHmsCustomization_InjectHmsErrorCode(uint32_t errorCode, E_DjiHmsErrorLevel errorLevel);
参数
errorCodeHMS 错误码。取值范围:[0x1E020000 ~ 0x1E02FFFF]。
返回值
返回值详情请参见:DjiErrorCode

Function DjiHmsCustomization_EliminateHmsErrorCode

清除应用程序上显示的自定义 HMS 错误码。

注意: 如需上报相同的 HMS 错误码,仅需调用一次接口,无需重复调用。

T_DjiReturnCode DjiHmsCustomization_EliminateHmsErrorCode(uint32_t errorCode);
参数
错误码:HMS 错误码。取值范围:[0x1E020000 ~ 0x1E02FFFF]。
返回值
返回值详情请参见:DjiErrorCode

Function DjiHmsCustomization_RegDefaultHmsTextConfigByDirPath

定义注册 HMS 默认文案配置文件的目录路径。

T_DjiReturnCode DjiHmsCustomization_RegDefaultHmsTextConfigByDirPath(const char *configDirPath);
参数
返回值
返回值详情请参见:DjiErrorCode

Function DjiHmsCustomization_RegHmsTextConfigByDirPath

定义注册 HMS 文案配置文件的目录路径。

注意: 不同语言的 HMS 文案配置需相同。

T_DjiReturnCode DjiHmsCustomization_RegHmsTextConfigByDirPath(E_DjiMobileAppLanguage appLanguage, const char *configDirPath);
参数
返回值
返回值详情请参见:DjiErrorCode

Function DjiHmsCustomization_RegDefaultHmsTextConfigByBinaryArray

使用二进制数组注册默认 HMS 文本配置。

注意: 在 RTOS 中通常没有文件系统,因此 HMS 文案配置文件内容可使用 C 语言数组来表示。使用此函数和 DjiHMS_RegDefaultHMSTextConfigByBinaryArray 注册 HMS 文案配置。当 DjiHms_RegHmsTextConfigByBinaryArray 中的设置未包括某种语言时,HMS 文案配置将沿用此函数的设置。

T_DjiReturnCode DjiHmsCustomization_RegDefaultHmsTextConfigByBinaryArray(const T_DjiHmsBinaryArrayConfig *binaryArrayConfig);
参数
返回值
返回值详情请参见: DjiErrorCode

Function DjiHmsCustomization_RegHmsTextConfigByBinaryArray

使用二进制数组注册 HMS 文案配置。

注意: 不同语言的 HMS 文案配置需相同。

T_DjiReturnCode DjiHmsCustomization_RegHmsTextConfigByBinaryArray(E_DjiMobileAppLanguage appLanguage, const T_DjiHmsBinaryArrayConfig *binaryArrayConfig);
参数
返回值
返回值详情请参见:DjiErrorCode

若您对文档有意见或疑惑,点击可快速反馈,我们会与您联系。