DEPENDS = "zenity dbus"
RDEPENDS = "zenity dbus"
-PR = "r90"
+PR = "r91"
SRC_URI = " \
file://op_paths.sh \
file://op_wifi.sh \
file://op_wifi.pnd \
file://op_bluetooth.sh \
+ file://op_bluetooth_work.sh \
file://op_bluetooth-check.desktop \
file://op_bluetooth.desktop \
file://op_startupmanager.sh \
install -m 0755 ${WORKDIR}/op_cpusettings.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_wifi.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_bluetooth.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_bluetooth_work.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_startupmanager.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_switchgui.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_calibrate.sh ${D}${prefix}/pandora/scripts/
then
notify-send -u normal "Bluetooth" "Bluetooth is being disabled..." -i blueman -t 5000
sudo /usr/sbin/hciconfig ${INTERFACE} down 1>/dev/null
+ sudo /usr/pandora/scripts/op_bluetooth_work.sh 0
rm -f "$LOCK"
else
- kernel_major=`uname -r | cut -c 1`
- if [ "$kernel_major" = "3" ]; then
- zenity --info --title="Bluetooth not supported" --text "Sorry, the experimental kernel does not support Bluetooth (yet).\n\nIt could not be enabled."
- exit 1
- else
+ if ! sudo /usr/pandora/scripts/op_bluetooth_work.sh 1; then
+ notify-send -u normal "Bluetooth" "Bluetooth error" -i blueman -t 3000
+ exit 1
+ fi
+
pgrep bluetoothd
echo $INTERFACE
if [ $? -ne 1 ]; then
sudo /usr/sbin/hciconfig ${INTERFACE} up pscan 1>/dev/null
sudo /usr/sbin/bluetoothd 1>/dev/null
touch "$LOCK"
-
fi
fi
- fi
fi
--- /dev/null
+#!/bin/sh
+
+kernel_major=`uname -r | cut -c 1`
+if [ "$kernel_major" = "2" ]; then
+ # new kernel only (for now)
+ exit 0
+fi
+
+if [ "$1" = "1" ]; then
+ if [ ! -e /sys/class/gpio/gpio15/value ]; then
+ echo 15 > /sys/class/gpio/export
+ sleep 0.2
+ echo out > /sys/class/gpio/gpio15/direction
+ fi
+ echo 1 > /sys/class/gpio/gpio15/value
+ hciattach /dev/ttyO0 texasalt 3000000
+ INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`"
+ if [ -z "$INTERFACE" ]; then
+ killall hciattach
+ echo 0 > /sys/class/gpio/gpio15/value
+ exit 1
+ fi
+ echo 255 > '/sys/class/leds/pandora::bluetooth/brightness'
+ exit 0
+elif [ "$1" = "0" ]; then
+ killall hciattach
+ echo 0 > /sys/class/gpio/gpio15/value
+ echo 0 > '/sys/class/leds/pandora::bluetooth/brightness'
+ exit 0
+else
+ echo "invalid argument"
+ exit 1
+fi
+