2

I want to use tcdrain with termios2.

The problem is the method is defined in termios.h, but not in asm/termbits.h.

It is not possible to use termios.h with asm/termbits.h together as there would have compilation errors as some of the structs are defined in both files.

Background: I would like to control my serial transmission by invoking tcdrain after write to make sure my data have transmitted before continue execution of my program. I would like also use custom serial speeds (thus, using termios2).

How do I use tcdrain with termios2?

Community
  • 1
  • 1
Kong Chun Ho
  • 268
  • 4
  • 14

1 Answers1

0

tcdrain is a simple ioctl call:

ioctl (fd, TCSBRK, 1)
vegalock
  • 51
  • 7