資源簡介
uart數據解析,針對串口通信的數據進行解析,每次讀一個字節,首先尋找協議包頭;中斷調用或者while(1)調用;
代碼片段和文件信息
void?issc_data_ind(unsigned?char?*sResultLineunsigned?char?nLen)
{
switch(sResultLine[0])
{
case?0x00:
break;
case?0x01:
{
swtich(sResultLine[1])
{
case?0x00:
break;
default:
break;
}
}
default:
break;
}
}
unsigned?char?cCurr?=?0;
unsigned?char?nCount?=?0;
unsigned?short?length?=?0;
unsigned?short?iISSC?=?0;
unsigned?char?nISSCStatus?=?0;
unsigned?char?sResultLine[MAX_REV_BT_LENGTH]?=?0;
unsigned?char?bPhoneBookData?=?0;
void?bt_handle(void)
{
while(1)
{
if(readbyte(&g_tl_ringbuff_t&cCurr))
{
if(1?==?nISSCStatus)
{
iISSC++;
/*
if((iISSC?>=?MAX_REV_BT_LENGTH)&&(0?==?bPhoneBookData))
{
sResultLine[iISSC-1]?=?cCurr;
sResultLine[iISSC]?=?0;
issc_data_in
評論
共有 條評論