返回值为函数指针函数
static uint8 hfp_time_format_check(const uint8 *data_buff,uint8 length,uint8 format)
{
uint8 time[3];
if(BCD == format)
{
if(false == hfp_Isbcddataarray(data_buff,0x03))
{
return false;
}
hfp_bcd_array_to_hex_array(data_buff, time, 0x03);
}
else if(HEX != format)
{
return false;
}
if((*time > 59) || (*(time+1) > 59) || (*(time+2) > 23))
{
return false;
}
return true;
}
const uint8 CODE (*data_check_table[])(uint8 *,uint8,uint8) =
{
__NULL,
hfp_time_format_check,
};
const uint8 CODE data_check_fun_num = sizeof(data_check_table)/sizeof(data_check_table[0]);
const uint8 CODE (*find_check_fun(uint8 index))(uint8 *,uint8,uint8)
{
if(index >= data_check_fun_num)
{
return __NULL;
}
return data_check_table[index];
}