Linux serial port reading - can I change size of input buffer?

后端 未结 2 1033
时光说笑
时光说笑 2021-02-20 15:39

I am writing an application on Ubuntu Linux in C++ to read data from a serial port. It is working successfully by my code calling select() and then ioctl(fd,F

2条回答
  •  天命终不由人
    2021-02-20 16:28

    You want to use the serial IOCTL TIOCSSERIAL which allows changing both receive buffer depth and send buffer depth (among other things). The maximums depend on your hardware, but if a 16550A is in play, the max buffer depth is 14.

    You can find code that does something similar to what you want to do here

    The original link went bad: http://www.groupsrv.com/linux/about57282.html The new one will have to do until I write another or find a better example.

提交回复
热议问题