简体   繁体   中英

Is it possible to send notification message to user app when data arrives at serial port (RS232) in Linux?

I know Linux can register udev events for USB accessories when it connects/disconnects to system, through udev apps can get notified on USB events so necessary action can be applied by applications.

Is there any ways we can do same event notifications to user apps for serial peripherals (RS232) ? Does linux support any such infrastructure which can do this? Basically I was read data from serial port as it arrives to serial port rather than creating a thread and waiting for data from serial port.

Without poll(ing)/select(ing) on the serial device with a program/daemon, you can not react if data arrives on the serial console.

You can write a own kernel-driver, but this needs more effort.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM