Commit abfafd11 authored by deuce's avatar deuce
Browse files

Use TIOCMBI? ioctls for better efficiency.

parent 45d34242
......@@ -150,26 +150,14 @@ int comGetModemStatus(COM_HANDLE handle)
BOOL comRaiseDTR(COM_HANDLE handle)
{
int status;
if(ioctl(handle, TIOCMGET, &status)==-1)
return FALSE;
status |= TIOCM_DTR;
if(ioctl(handle, TIOCMSET, &status)==-1)
return FALSE;
return TRUE;
int flags = TIOCM_DTR;
return(ioctl(handle, TIOCMBIS, &flags)==0)
}
BOOL comLowerDTR(COM_HANDLE handle)
{
int status;
if(ioctl(handle, TIOCMGET, &status)==-1)
return FALSE;
status &= ~TIOCM_DTR;
if(ioctl(handle, TIOCMSET, &status)==-1)
return FALSE;
return TRUE;
int flags = TIOCM_DTR;
return(ioctl(handle, TIOCMBIC, &flags)==0)
}
BOOL comWriteByte(COM_HANDLE handle, BYTE ch)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment