Alexandr Shutko
Alexandr Shutko

Reputation: 1875

Is there any way to control uart rx fifo size in linux programmaticaly

I'm writing software to communicate with badly designed hardware. This hardware can communicate with linux pc (kernel 4.15) by RS485 line (9600 8N1) and it has very short timings: pc should reply in 2ms after receiving request from device.

I was able to solve this task using LOW_LATENCY flag and /sys/class/tty/ttySx/rx_trig_bytes file.

After opening port "rx_trig_bytes" file contents changes to "14", so I need write "1" to it after opening port to get good reply latency.

Is there any way to make this by API call or fix it after system boot / driver load ? Current realization looks ugly :(

Upvotes: 1

Views: 2886

Answers (1)

Marcos G.
Marcos G.

Reputation: 3506

Funny you find this way ugly, considering everything is a file in Unix, it should be the smart way.

I guess you are entitled to your own aesthetic sense.

If you want to make another buffer size the default you can always change it in the driver and recompile the kernel as suggested here.

Upvotes: 1

Related Questions