Hardware Reference
In-Depth Information
The following shows an example of use:
struct termios term;
int rc;
...
rc = tcsetattr(fd,TCSADRAIN,&term);
if ( rc < 0 ) {
perror("tcsetattr(3)");
tcsendbreak(3)
A break signal can be transmitted to the remote end by calling the tcsendbreak(3)
function:
int tcsendbreak(int fd, int duration);
where
fd is the open TTY file descriptor.
duration is the amount of time to use to represent a break.
When the argument duration is zero, it sends a break signal lasting between
0.25 and 0.5 seconds. When the argument is nonzero, the man page states that some
implementation-defined amount of time is used instead.
int rc;
rc = tcsendbreak(fd,0);
if ( rc < 0 ) {
perror("tcsendbreak(3)");
tcdrain(3)
The function tcdrain(3) can be used to block the execution of the calling program until
all of the output characters have been transmitted out of the UART:
int tcdrain(int fd);
where
fd is the open TTY file descriptor. An example follows:
int rc;
rc = tcdrain(fd);
if ( rc < 0 ) {
perror("tcdrain(3)");
 
Search WWH ::




Custom Search