自定义 HMS 功能
目录
E_DjiHmsErrorLevel
T_DjiHmsFileBinaryArray
T_DjiHmsBinaryArrayConfig
DjiHmsCustomization_Init
DjiHmsCustomization_DeInit
DjiHmsCustomization_InjectHmsErrorCode
DjiHmsCustomization_EliminateHmsErrorCode
DjiHmsCustomization_RegDefaultHmsTextConfigByDirPath
DjiHmsCustomization_RegHmsTextConfigByDirPath
DjiHmsCustomization_RegDefaultHmsTextConfigByBinaryArray
DjiHmsCustomization_RegHmsTextConfigByBinaryArray
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;
typedef struct {
char *fileName; /*!< 定义 HMS 文案配置文件名。*/
uint32_t fileSize; /*!< 定义 HMS 文案配置文件的大小。单位为 byte。 */
const uint8_t *fileBinaryArray; /*!< 定义 HMS 文案配置文件的 C 语言数组。*/
} T_DjiHmsFileBinaryArray;
typedef struct {
uint16_t binaryArrayCount; /*!< 二进制数组的元素计数。*/
T_DjiHmsFileBinaryArray *fileBinaryArrayList; /*!< 指向二进制数组列表的指针。*/
} T_DjiHmsBinaryArrayConfig;
函数原型
初始化自定义 HMS 功能模块。用户在使用自定义 HMS 功能模块之前应调用此函数。
T_DjiReturnCode DjiHmsCustomization_Init(void);
返回值
返回值详情请参见:DjiErrorCode
去初始化自定义 HMS 功能。
T_DjiReturnCode DjiHmsCustomization_DeInit(void);
返回值
返回值详情请参见:DjiErrorCode
向应用程序上报自定义 HMS 错误码。
注意: 如需上报相同的 HMS 错误码,仅需调用一次接口,无需重复调用。
T_DjiReturnCode DjiHmsCustomization_InjectHmsErrorCode(uint32_t errorCode, E_DjiHmsErrorLevel errorLevel);
errorCodeHMS 错误码。取值范围:[0x1E020000 ~ 0x1E02FFFF]。
返回值
返回值详情请参见:DjiErrorCode
清除应用程序上显示的自定义 HMS 错误码。
注意: 如需上报相同的 HMS 错误码,仅需调用一次接口,无需重复调用。
T_DjiReturnCode DjiHmsCustomization_EliminateHmsErrorCode(uint32_t errorCode);
错误码:HMS 错误码。取值范围:[0x1E020000 ~ 0x1E02FFFF]。
返回值
返回值详情请参见:DjiErrorCode
定义注册 HMS 默认文案配置文件的目录路径。
T_DjiReturnCode DjiHmsCustomization_RegDefaultHmsTextConfigByDirPath(const char *configDirPath);
返回值
返回值详情请参见:DjiErrorCode
定义注册 HMS 文案配置文件的目录路径。
注意: 不同语言的 HMS 文案配置需相同。
T_DjiReturnCode DjiHmsCustomization_RegHmsTextConfigByDirPath(E_DjiMobileAppLanguage appLanguage, const char *configDirPath);
返回值
返回值详情请参见:DjiErrorCode
使用二进制数组注册默认 HMS 文本配置。
注意: 在 RTOS 中通常没有文件系统,因此 HMS 文案配置文件内容可使用 C 语言数组来表示。使用此函数和 DjiHMS_RegDefaultHMSTextConfigByBinaryArray 注册 HMS 文案配置。当 DjiHms_RegHmsTextConfigByBinaryArray 中的设置未包括某种语言时,HMS 文案配置将沿用此函数的设置。
T_DjiReturnCode DjiHmsCustomization_RegDefaultHmsTextConfigByBinaryArray(const T_DjiHmsBinaryArrayConfig *binaryArrayConfig);
返回值
返回值详情请参见: DjiErrorCode
使用二进制数组注册 HMS 文案配置。
注意: 不同语言的 HMS 文案配置需相同。
T_DjiReturnCode DjiHmsCustomization_RegHmsTextConfigByBinaryArray(E_DjiMobileAppLanguage appLanguage, const T_DjiHmsBinaryArrayConfig *binaryArrayConfig);
返回值
返回值详情请参见:DjiErrorCode