CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
结构体 | 宏定义 | 类型定义 | 函数 | 变量
command_info_v3.c 文件参考
#include "stdio.h"
#include "command_info.h"
#include "dichotomy_find.h"
#include "ci_flash_data_info.h"
#include "FreeRTOS.h"
#include "semphr.h"
#include "string.h"
#include "ci_log.h"
#include "romlib_runtime.h"

结构体

struct  cmd_info_variable_st
 

宏定义

#define MAX_COMBINATION_COUNT   16
 
#define cmd_info_malloc(x)   pvPortMalloc(x)
 
#define cmd_info_free(x)   vPortFree(x)
 

类型定义

typedef struct cmd_info_variable_st cmd_info_variable_t
 

函数

static uint32_t cmd_info_change_cur_model_group_inner (uint8_t model_group_id)
 
uint32_t is_valid_cmd_handle (cmd_handle_t cmd_handle)
 检查一个命令词信息结构句柄是否有效。 更多...
 
uint32_t cmd_info_init (uint32_t cmd_file_addr_in_flash, uint32_t voice_patition_addr, uint8_t model_group_id)
 初始化命令词信息模块。注意,每交切换识别模型后,都需要调用一次此接口。 更多...
 
uint32_t cmd_info_change_cur_model_group (uint8_t model_group_id)
 切换当前的工作的识别模型组。也就是切换命令词信息excel表格中的多个sheet之间切换。 更多...
 
uint32_t cmd_info_get_cur_model_id (uint32_t *p_dnn_id, uint32_t *p_asr_id, uint32_t *p_voice_group_id)
 获取当前正在运行的模型ID。 更多...
 
void cmd_info_destroy ()
 释放命令词信息模块所占用的内存资源,此模块的初cmd_info_init以外的接口都不能再使用。下次要调用要调用此模块的其他查询接口,必须要先通过cmd_info_init接口初始化。 更多...
 
static int cmd_string_find_callback (void *pValue, int index, void *CallbackPara)
 
static int cmd_id_find_callback (void *pValue, int index, void *CallbackPara)
 
cmd_handle_t cmd_info_find_command_by_id (uint16_t cmd_id)
 通过命令词ID查找命令词信息句柄。使用此句柄和其他查询接口,可以获取命令词的每一项具体信息,比如命令词ID、语言ID、识别阈值分数、对应的提示音等等。 更多...
 
cmd_handle_t cmd_info_find_command_by_string (const char *cmd_string)
 通过命令词字符串查找命令词信息句柄。使用此句柄和其他查询接口,可以获取命令词的每一项具体信息,比如命令词ID、语言ID、识别阈值分数、对应的提示音等等。 更多...
 
cmd_handle_t cmd_info_find_command_by_semantic_id (uint32_t semantic_id)
 通过命令词语义ID查找命令词信息句柄。使用此句柄和其他查询接口,可以获取命令词的每一项具体信息,比如命令词ID、语言ID、识别阈值分数、对应的提示音等等。 更多...
 
cmd_handle_t cmd_info_find_command_by_recieve_data (uint8_t *data, uint8_t data_length)
 
uint16_t cmd_info_get_command_id (cmd_handle_t cmd_handle)
 通过命令词信息结构的句柄获取命令词ID。 更多...
 
static uint16_t get_command_index (cmd_handle_t cmd_handle)
 
char * cmd_info_get_command_string (cmd_handle_t cmd_handle)
 通过命令词信息结构的句柄获取命令词字符串。 更多...
 
uint8_t cmd_info_get_cmd_score (cmd_handle_t cmd_handle)
 通过命令词信息结构的句柄获取命令词识别的阈值分数。 更多...
 
uint32_t cmd_info_get_semantic_id (cmd_handle_t cmd_handle)
 通过命令词信息结构的句柄获取命令词的语义ID。 更多...
 
uint8_t cmd_info_get_cmd_flag (cmd_handle_t cmd_handle)
 获取命令词信息中的标记信息。 更多...
 
uint32_t cmd_info_is_special_word (cmd_handle_t cmd_handle)
 检查指定的命令词是否是特殊词(特殊词在识别阈值分数达到后,还需要等待指定的识别次数才会输出识别结果)。 更多...
 
uint32_t cmd_info_is_auto_play (cmd_handle_t cmd_handle)
 Checks whether the specifiled command word have auto play flag. 更多...
 
uint32_t cmd_info_is_wakeup_word (cmd_handle_t cmd_handle)
 检查指定的命令词是否是唤醒词。 更多...
 
uint32_t cmd_info_is_combo_word (cmd_handle_t cmd_handle)
 检查指定的命令词是否是组合词。 更多...
 
uint32_t cmd_info_is_expected_word (cmd_handle_t cmd_handle)
 检查指定的命令词是否为期望词。 更多...
 
uint32_t cmd_info_is_unexpected_word (cmd_handle_t cmd_handle)
 检查指定的命令词是否为不期望词。 更多...
 
static int wait_count_find_callback (void *pValue, int index, void *CallbackPara)
 
int32_t cmd_info_get_special_wait_count (cmd_handle_t cmd_handle)
 获取指定命令词的等待时间。 更多...
 
static uint8_t get_combination_voice_number (voice_info_t *p_voice_info_table, uint16_t start_index, uint16_t end_index)
 
int32_t cmd_info_get_voice_index (uint16_t start_index, uint16_t end_index, uint8_t select_index, uint16_t *id_buffer, int buffer_length)
 获取提示音数据的ID号,也就是打包固件时,提供的音频文件名中方括号中的数字。如果是组合播报或选择播报,会返回多个ID,所以需要调用者提供一个uint16_t的数组来接收多个ID。 更多...
 
uint32_t cmd_info_get_voice_index_from_handle (cmd_handle_t cmd_handle, uint16_t *start_index, uint16_t *end_index)
 通过命令词信息结构句柄获取命令词对应的提示间的起始索引和结束索引。 更多...
 
uint16_t cmd_info_get_function_id (cmd_handle_t cmd_handle)
 通过命令词信息结构的句柄获取命令词的功能号。 更多...
 
cmd_sr_data_tcmd_info_get_send_data (cmd_handle_t cmd_handle)
 

变量

cmd_info_variable_t cmd_info_variable = {0}
 

结构体说明

◆ cmd_info_variable_st

struct cmd_info_variable_st
成员变量
uint8_t check_number
uint32_t cmd_str_index_table_size
uint32_t cmd_table_size
uint32_t command_number
uint8_t is_changing_model
command_string_index_t * p_cmd_str_index_table
command_info_t * p_cmd_table
special_wait_count_t * p_special_word_table
char * p_string_table
uint8_t recieve_data_item_len
uint8_t * recieve_data_table
SemaphoreHandle_t semaphore
uint8_t send_data_item_len
uint8_t * send_data_table
uint32_t special_word_number
uint32_t special_word_table_size
uint32_t string_table_size
uint32_t voice_patition_addr

宏定义说明

◆ cmd_info_free

#define cmd_info_free (   x)    vPortFree(x)

◆ cmd_info_malloc

#define cmd_info_malloc (   x)    pvPortMalloc(x)

◆ MAX_COMBINATION_COUNT

#define MAX_COMBINATION_COUNT   16

类型定义说明

◆ cmd_info_variable_t

函数说明

◆ cmd_id_find_callback()

static int cmd_id_find_callback ( void *  pValue,
int  index,
void *  CallbackPara 
)
static

◆ cmd_info_change_cur_model_group_inner()

static uint32_t cmd_info_change_cur_model_group_inner ( uint8_t  model_group_id)
static

◆ cmd_info_find_command_by_recieve_data()

cmd_handle_t cmd_info_find_command_by_recieve_data ( uint8_t *  data,
uint8_t  data_length 
)

◆ cmd_info_get_function_id()

uint16_t cmd_info_get_function_id ( cmd_handle_t  cmd_handle)

通过命令词信息结构的句柄获取命令词的功能号。

参数
cmd_handle命令词信息结构句柄。
返回
uint32_t 返回命令词对应的功能号,用于指定在识别到此命令时,需要执行的某些操作或者要发送的数据。

◆ cmd_info_get_send_data()

cmd_sr_data_t* cmd_info_get_send_data ( cmd_handle_t  cmd_handle)

◆ cmd_info_is_auto_play()

uint32_t cmd_info_is_auto_play ( cmd_handle_t  cmd_handle)

Checks whether the specifiled command word have auto play flag.

参数
cmd_handleA handle to the specifiled command.
返回
uint32_t 1:yes, 0:no

◆ cmd_string_find_callback()

static int cmd_string_find_callback ( void *  pValue,
int  index,
void *  CallbackPara 
)
static

◆ get_combination_voice_number()

static uint8_t get_combination_voice_number ( voice_info_t p_voice_info_table,
uint16_t  start_index,
uint16_t  end_index 
)
static

◆ get_command_index()

static uint16_t get_command_index ( cmd_handle_t  cmd_handle)
static

◆ wait_count_find_callback()

static int wait_count_find_callback ( void *  pValue,
int  index,
void *  CallbackPara 
)
static

变量说明

◆ cmd_info_variable

cmd_info_variable_t cmd_info_variable = {0}