📄 dt_analyzer.c
字号:
}
else
{
/*otherwise, return ERROR when state is IDLE*/
dt_result_code_fmttr (DT_RCODE_ERROR, DT_ERR_INVALID_CMD);
}
}
return;
}
/*****************************************************************************
* FUNCTION
* dt_process_one_cmd
*
* DESCRIPTION
* This is dt_process_one_cmd function of L4C module.
* detect CR to identify a full cmd line and then process
* that line of at cmd
*
* PARAMETERS
* none.
*
* RETURNS
* none.
*
* GLOBALS AFFECTED
* none.
*****************************************************************************/
void dt_process_one_cmd (void)
{
kal_bool full_cmd = KAL_FALSE;
kal_uint16 i, j, index;
dt_string_struct temp_struct;
kal_trace(TRACE_FUNC, FUNC_DT_PROCESS_ONE_CMD_ENTRY);
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
#ifdef __BTVCSR_HP__ /* bluetooth : 2 physical uart */
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#ifdef l4c_autobaud
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
#endif
/* skip the beginnig Null terminaters (PC always throw a lot Null when query the modem. */
for (i=0; i<DT_PTR->uart_input_queue.length; i++)
{
index = (DT_PTR->uart_input_queue.head + i) % DT_MAX_DATA_INPUT_QUEUE_LENGTH ;
if (DT_PTR->uart_input_queue.data[index] != DT_END_OF_STRING_CHAR
&& DT_PTR->uart_input_queue.data[index] != 13
&& DT_PTR->uart_input_queue.data[index] != 10)
break; //we found the first charactor.
}
DT_PTR->uart_input_queue.head =
(DT_PTR->uart_input_queue.head+i) % DT_MAX_DATA_INPUT_QUEUE_LENGTH;
DT_PTR->uart_input_queue.length -= i;
for (i=0; i<DT_PTR->uart_input_queue.length; i++)
{
index = (DT_PTR->uart_input_queue.head + i) % DT_MAX_DATA_INPUT_QUEUE_LENGTH ;
if ((DT_PTR->uart_input_queue.data[index] == 13) ||
(DT_PTR->uart_input_queue.data[index] == 10))
{
i++;
full_cmd = KAL_TRUE;
break;
}
}
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#ifdef __BTVCSR_HP__
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
/* under construction !*/
/* under construction !*/
/* under construction !*/
#ifdef __BTVCSR_HP__
/* under construction !*/
/* under construction !*/
#endif
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#ifdef __BTVCSR_HP__
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
if (full_cmd == KAL_TRUE)
{
if (i <= 1)
{
DT_PTR->uart_input_queue.head =
(DT_PTR->uart_input_queue.head+i) % DT_MAX_DATA_INPUT_QUEUE_LENGTH;
DT_PTR->uart_input_queue.length -= i;
return;
}
temp_struct.index = 0;
ASSERT(i+1 <2048);
temp_struct.string_ptr = get_ctrl_buffer((kal_uint16)(i+1));
kal_mem_set (temp_struct.string_ptr, 0, sizeof (kal_uint8) * (i+1));
for (j=0; j<i-1; j++)
{
temp_struct.string_ptr[j] =
DT_PTR->uart_input_queue.data
[(DT_PTR->uart_input_queue.head+j) % DT_MAX_DATA_INPUT_QUEUE_LENGTH];
}
temp_struct.string_ptr[i-1] = DT_PTR->s_reg.s3;
DT_PTR->uart_input_queue.head =
(DT_PTR->uart_input_queue.head+i) % DT_MAX_DATA_INPUT_QUEUE_LENGTH ;
DT_PTR->uart_input_queue.length -= i;
temp_struct.src_id = 0xff/*src_id*/;
//#ifdef __BTVCSR_HP__
// if (cid == 1)
// DT_PTR->BT_port = KAL_TRUE;
// else
// DT_PTR->BT_port = KAL_FALSE;
//#endif
dt_cmd_processor (&temp_struct, i);
//#ifdef __BTVCSR_HP__
// if (DT_PTR->BT_port == KAL_TRUE)
// DT_PTR->BT_port = KAL_FALSE;
//#endif
free_ctrl_buffer (temp_struct.string_ptr);
}
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -