I have an embedded Atmel ARM926 board that I created a usb serial ko to get data from an FTDI as USBtty0. This board also has a serial port DBGU which is used as the console terminal that normally runs at 230kb. When I config the USBtty0 port to the required 115kb, DBGU apparently changes to 115kb as well.
if( m_fdELMdev = open(m_ELMdevice, O_RDWR | O_NOCTTY )< 0)
{//error
}
else
{
// Configure the port
tcgetattr(m_fdELMdev, &dev_settings);
dev_settings.c_cflag |= B115200;
cfmakeraw(&dev_settings);
}
Can someone please tell me what I might be doing wrong? This is snippet of my devices.tab
/dev/tty c 640 0 0 4 0 0 1 4
/dev/tty c 640 0 0 5 0 - - -
/dev/ttyGS c 640 0 0 252 0 - - -
/dev/ttyS c 640 0 0 4 64 0 1 3
/dev/watchdog c 640 0 0 10 130 - - -
/dev/zero c 640 0 0 1 5 - - -
/dev/ttyACM0 c 640 0 0 166 0 - - -
/dev/ttyUSB0 c 640 0 0 188 0 - - -
Also, I occasionally see some 'Interrupted System Calls' from select. How do I need to handle these? Do I retry the select until I get some data? Then what if I never get any data?
enter code here
do
{
iret = select(m_fdELMdev + 1, &fdrefid, NULL, NULL, &porttime);
switch(iret)
{
case READ_TIMEOUT:
ierr = -1;
break;
case READ_ERROR:
g_dbg->debug("CACS_Elm327::Select error:%s (%d)\n",strerror(errno), errno);
ierr = -1;
break;
default:
iret = read(m_fdELMdev, data, ilen);
g_dbg->debug("CACS_Elm327::Readport_ELM:read %s %d\n", data, iret );
break;
}
}while((ierr == 0) && (iret<ilen) );