Files
infix/package/profeth/set_profinet_leds
T
Joachim Wiberg e33f191d07 package/profeth: add support for starting and monitoring PROFINET
An Infix build with PROFINET gears Net-SNMP heavily towards acting as a
servant to profeth (p-net stack).  This will be hard-coded for now until
we've integrated it all better in Clixon.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-06 10:50:58 +01:00

25 lines
651 B
Bash
Executable File

#!/bin/sh
# Used by profeth to flash LED(s), only a dummy for now
if [ $# -ne 2 ]; then
echo "Usage: ${0} led_number led_state"
echo " where:"
echo " led_number: LED number. Number 1 for sample app data LED"
echo " Number 2 for mandatory Profinet signal LED"
echo " led_state: 1 for on, 0 for off"
echo " Exit code: 0 on success, 1 on error"
exit 1
fi
LED_NUMBER=$1
LED_STATE=$2
if ! [ "${LED_STATE}" = "0" -o "${LED_STATE}" = "1" ]; then
echo "Wrong LED state: ${LED_STATE}"
exit 1
fi
echo ${LED_STATE} > "/tmp/pnet_led_${LED_NUMBER}.txt"
exit 0