Hi,
I used le_fdMonitor_Create () function to monitor file descriptor receive side data.But the callback is generating after some delay .
I used to monitor serial data output .Input is feeding continuously.
Sometimes callback is not generated around 25 ms.
Example Code:
fd = le_tty_Open(“/dev/ttyUSB3”, O_RDWR | O_NOCTTY);
** ExtUART_fd=fd;**
** if(fd<0)**
** {**
** LE_ERROR(“EXT_UART SERIAL OPEN FAILED %d”,fd);**
** return;**
** }**
** else**
** {**
** LE_INFO(“EXT_UART SERIAL OPEN SUCCESS”);**
** }**
** usleep(100000);**
** if((ret=le_tty_SetBaudRate(fd,GLOB_IRU_CurSettings.UART_1Setting.UART_Baudrate))!=LE_OK)**
** {**
** LE_INFO(“Baudrate:%d”,GLOB_IRU_CurSettings.UART_1Setting.UART_Baudrate);**
** LE_ERROR(“EXT_UART SETBAUDRATE FAILED “); LE_INFO(”%d”,ret);
}**
else**
{**
LE_INFO(“EXT_UART SETBAUDRATE SUCCESS”);**
}**
usleep(10000);
if(le_tty_SetFraming(fd,GLOB_IRU_CurSettings.UART_1Setting.parity,GLOB_IRU_CurSettings.UART_1Setting.DataBits,GLOB_IRU_CurSettings.UART_1Setting.stopBits)!=LE_OK)
LE_ERROR("EXT_UART SET_FRAMING FAILED");
else
LE_INFO("EXT_UART SET_FRAMING SUCCESS");
if(le_tty_SetFlowControl(fd,LE_TTY_FLOW_CONTROL_NONE)!=LE_OK)
LE_ERROR("EXT_UART SET_FLOW CONTROL FAILED");
if(le_tty_SetRaw(fd,0,UART_READ_TIMEOUT)!=LE_OK)
LE_ERROR("EXT_UART SET_RAW FAILED");
fdMonitor=le_fdMonitor_Create("Serial Port",fd,Uart_Recv_Char_CallBack,POLLIN);
if(fdMonitor)
{
LE_INFO("EXT_UART FD MONITOR OBJECT CREATED");
}
fcntl(ExtUART_fd, F_SETFL,O_NONBLOCK);