debug && echo "powerstate=$powerstate"
suspend_net() {
- hcistate=$(hciconfig hci0 | grep DOWN)
- if [ $hcistate ]; then
- echo "down" > /tmp/hcistate
+ # This is kernel 3.x only,
+ # but ignored since 2.6 only has lowpower anyways (no suspend)
+ if (ps -A | grep -q hciattac[h]); then
+ touch /tmp/bt-state-up
+ /usr/pandora/scripts/op_bluetooth_work.sh 0
else
- echo "up" > /tmp/hcistate
- hciconfig hci0 down
+ rm -f /tmp/bt-state-up
fi
+
wlstate=$(lsmod | grep -m1 wl1251)
if [ -z "$wlstate" ]; then
echo "down" > /tmp/wlstate
}
resume_net() {
- hcistate=$(cat /tmp/hcistate)
- if [ "$hcistate" = "up" ]; then
+ if [ -f /tmp/bt-state-up ]; then
+ /usr/pandora/scripts/op_bluetooth_work.sh 1
hciconfig hci0 up pscan
fi
wlstate=$(cat /tmp/wlstate)