disconnect a communications line
#include <termios.h> int tcdropline( int fd, int duration );
The tcdropline() function initiates a disconnect condition on the communication line associated with the opened file descriptor indicated by fd.
The disconnect condition will be approximately 300 milliseconds if duration is zero, otherwise the condition will last for at least duration milliseconds. The system will round the effective value of duration up to the next highest supported interval, which is typically a multiple of 100 milliseconds.
#include <termios.h> #include <fcntl.h> #include <unistd.h> void main() { int fd; fd = open( "/dev/ser1", O_RDWR ); /* * Disconnect for 500 milliseconds */ tcdropline( fd, 500 ); close( fd ); }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
errno, tcdrain(), tcflow(), tcflush()