Цитата(ASN @ Sep 30 2008, 21:22)

Если не трудно, можно получить ссылку на пример использования DTR/DSR в Linux?
http://linux.die.net/man/2/ioctl далее TIOCMGET/TIOCMSET
Код
//---------------------------------------------------------------------------
// Controls the modem lines to place the microcontroller into various
// states during the programming process.
//---------------------------------------------------------------------------
void control_MDM_lines( int DTR, int RTS )
{
#if defined COMPILE_FOR_LINUX
int status;
if( ioctl( ie.fdCom, TIOCMGET, &status ) == 0 )
dprint( 1, "Ioctl get ok, status = %X\n", status );
else
dprint( 1, "Ioctl get failed\n" );
if( DTR )
status |= TIOCM_DTR;
else
status &= ~TIOCM_DTR;
if( RTS )
status |= TIOCM_RTS;
else
status &= ~TIOCM_RTS;
if( ioctl( ie.fdCom, TIOCMSET, &status ) == 0 )
dprint( 1, "Ioctl set ok, status = %X\n", status );
else
dprint( 1, "Ioctl set failed\n" );
if( ioctl( ie.fdCom, TIOCMGET, &status ) == 0)
dprint( 1, "Ioctl get ok, status = %X\n", status );
else
dprint( 1, "Ioctl get failed\n" );
#endif // defined COMPILE_FOR_LINUX