recipes-core: suspend: down the bluetooth interface before entering suspend
Down the bluetooth interface before entering suspend and up it after resuming if it is present and up. https://jira.digi.com/browse/DEL-2806 Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
parent
fc959bd23f
commit
5e35a9ca00
|
|
@ -29,12 +29,16 @@ suspend_interfaces() {
|
||||||
if grep -qs '^wlan0' /var/run/ifstate; then
|
if grep -qs '^wlan0' /var/run/ifstate; then
|
||||||
ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 && rmmod wlan
|
ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 && rmmod wlan
|
||||||
fi
|
fi
|
||||||
|
if hcitool -i hci0 dev >/dev/null 2>&1; then
|
||||||
|
hciconfig hci0 down && up_hci0_on_resume="1" && sleep 0.5
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
resume_interfaces() {
|
resume_interfaces() {
|
||||||
if ! grep -qs '^wlan0' /var/run/ifstate; then
|
if ! grep -qs '^wlan0' /var/run/ifstate; then
|
||||||
[ -n "${up_wlan_on_resume}" ] && modprobe wlan && sleep 0.5 && ifup wlan0
|
[ -n "${up_wlan_on_resume}" ] && modprobe wlan && sleep 0.5 && ifup wlan0
|
||||||
fi
|
fi
|
||||||
|
[ -n "${up_hci0_on_resume}" ] && hciconfig hci0 up
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts "h" c; do
|
while getopts "h" c; do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue