openwrt 下调试实现wifi 开启/关闭及设置指示灯

首先根据按键gpio端口号修改arch/mips/ath79/match-ap121.c的GPIO数值,

具体驱动文件是在trunk/package/kernel/gpio-button-hotplug/src gpio-button-hotplug.c文件。

应用程序检测到按键按下开调用以下脚本。并设置LED指示灯。

#!/bin/sh
SW=$(uci -q get wireless.@wifi-device[0].disabled)
[ "$SW" == "1" ] && uci set wireless.@wifi-device[0].disabled=0
[ "$SW" == "1" ] || uci set wireless.@wifi-device[0].disabled=1

wifi


LED设置

SW=$(uci -q get wireless.@wifi-device[0].disabled)
["$SW"=="1"] && echo 0 > brightness
["$SW"=="1"] || echo 1 > brightness
---------------------
作者:halsonhe
来源:CSDN
原文:https://blog.csdn.net/halsonhe/article/details/51007633
版权声明:本文为博主原创文章,转载请附上博文链接!

你可能感兴趣的:(openwrt 下调试实现wifi 开启/关闭及设置指示灯)