Hello Uwe,
+ LED on if line is high.
+ * RNG: DCE has detected an incoming ring signal.
+ LED on if line is high.
Something I (still) don't like about this approach is that you cannot
make the LED flash on TX only (or CAR and DSR). Something like:
led=/sys/class/leds/<led>/
echo 1 > $led/TX
echo 0 > $led/RX
echo 1 > $led/CAR
would be a more flexible and IMHO nicer interface. (Maybe with improved
file names.)
The question is whether it makes sense to combine several states on one
LED. We can add TTY_LED_RX or TTY_LED_TX to meet your requirements.
The only led trigger I know that combines multiple states is
ledtrig-netdev.
If so, I can only imagine that we handle it the same way as with
ledtrig-netdev. For the states CTS/DSR/CAR/RNG, the LED goes on or off
and when data is transmitted (rx/tx), the LED flashes.
I have personally have a usecase where I need to indicate whether
I am getting CTS from the mode or not.
If that's how we want to do it, then I can only imagine that:
led=/sys/class/leds/<led>/
echo 1 > $led/rx
echo 0 > $led/tx
echo <CTS|DSR|CAR|RNG> > $led/tty_led_mode
I think it only makes sense to always display only one mode
This are "CTS|DSR|CAR|RNG".
Personally, I think
it complicates things because the LED shows several states.
Best regards
Florian