Hi , I am trying to use UART_control and the command UART_CMD_GETRXCOUNT to check if there is data ready to be read fro the uart.
while UART_control returns 0 , the available rx bytes I see are always zero. I can do UART_Read , but I do not want to enter uart read if this is not necessary
I also noticed that UART_CMD_GETRXCOUNT is not defined in UART.h file.
is it supported ? any other way I can inquire availiable bytes in the uart rx buffer ?
UART_Params params;
UART_Params_init(¶ms);
params.readTimeout = 10;
params.readMode = UART_MODE_BLOCKING;
params.writeMode = UART_MODE_BLOCKING;
params.readEcho = UART_ECHO_ON;
params.readDataMode = UART_DATA_TEXT;
params.writeDataMode = UART_DATA_TEXT;
params.readReturnMode = UART_RETURN_NEWLINE;
params.baudRate = 115200;
//params.readCallback2 = &UartReadCallBack2;
//params.writeTimeout = 10;
UartHandle = UART_open(0, ¶ms);
while (1)
{
s16_uart_control_ret_val = UART_control(UartHandle,2,&s16_bytes_in_buffer); // ==UART_CMD_GETRXCOUNT
}