Is it possible to find out if the serial port is connected or disconnected in Linux?

Is it possible to request a specific serial port connected / disconnected on a linux machine? is there any way to read sysfs information for the request if a specific port is connected or not?

+3
source share
1 answer

It rather depends on what you mean by "connected." First, I turn to the least accurate, but simplest value.

Port existence

, , , , , /dev/ttyS 0 /dev/ttyUSB0, , (, /dev/ttyS 0, , ). USB hotplugged, , " " .

/

, , -, . , . , , . , - . , , .

, , , . , , . (, ), , . , , SCPI, , "* IDN?\N".

, , . , , , . UART ( , ), , , , - , .

, , "" , "".

+12

All Articles