You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
656 B
Awk

BEGIN {
FS="[ ,]"
}
/^INIT: [01]/ {
system( "uci -P/var/state revert plc.plc.simpleconnect" );
system( "uci -P/var/state set plc.plc.simpleconnect=0" );
if ( $2 == 1 ) {
system("logger \"plcgpio: Simple Connect sanity check triggered.\"");
}
}
/^EVENT: 1[34],/ {
system( "uci -P/var/state revert plc.plc.simpleconnect" );
system( "uci -P/var/state set plc.plc.simpleconnect=" ($2 - 13) * 256 + $3 );
if( $3 != 0 ) {
system( "uci -P/var/state revert plc.plc.joiner" );
}
}
/^JOINER:/ {
system( "uci -P/var/state revert plc.plc.joiner" );
system( "uci -P/var/state set plc.plc.joiner=" $2 );
}