#!/bin/sh module_id() { awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' /dev/null | tr -d \\0 } if [ -f /etc/sysconfig/bluetooth ]; then . /etc/sysconfig/bluetooth if [ $BLUETOOTH = "yes" ]; then # Turn echo off; if the bluetooth chip emits characters on power up, # they would be echoed back to the chip, confusing it. This should only # be necessary to do once, as hciattach turns echo off too (but too # late the first time, since the bluetooth chip is powered up when the # port is opened, before hciattach gets a chance to turn echo off). echo "Turning echo off on ${BLUETOOTH_PORT}" stty -echo < $BLUETOOTH_PORT fi else echo -n "Checking for built-in Bluetooth: " case `module_id` in "HP iPAQ H2200") BLUETOOTH=yes PORT=/dev/ttyS3 SPEED=921600 PROBE=no RADIO_VER=`h2200_radio_version` case $RADIO_VER in "141") # Zeevo PROTO=any ;; "525") # CSR PROTO=bcsp ;; *) echo "Unknown radio version '${RADIO_VER}'" ;; esac ;; "HP iPAQ H5400") BLUETOOTH=yes PORT=/dev/ttyS3 SPEED=921600 PROTO=any PROBE=yes ;; "HP iPAQ H3900") BLUETOOTH=yes PORT=/dev/ttyS1 SPEED=921600 PROTO=bcsp PROBE=yes ;; "HP iPAQ H3800") BLUETOOTH=yes PORT=/dev/ttySB0 SPEED=230400 PROTO=bcsp PROBE=yes ;; "HP iPAQ H4100" | "HP iPAQ H4300") BLUETOOTH=yes PORT=/dev/ttyS1 SPEED=115200 PROTO=texas PROBE=no ;; "HP iPAQ HX4700") BLUETOOTH=yes PORT=/dev/ttyS1 SCRIPT=/etc/bluetooth/TIInit_3.2.26.bts SPEED='`[ -f "$BLUETOOTH_SCRIPT" ] && echo 921600 || echo 115200`' PROTO=texas PROBE=no ;; "HP iPAQ H6300") BLUETOOTH=yes PORT=/dev/ttyS0 SPEED=115200 PROTO=texas PROBE=no ;; "IPAQ-H1940") BLUETOOTH=yes PORT=/dev/s3c2410_serial0 SPEED=460800 PROTO=any PROBE=no ;; "Acer-N30") BLUETOOTH=yes PORT=/dev/s3c2410_serial2 SPEED=115200 PROTO=bcsp PROBE=no ;; "HTC Universal" | "MIO A701") BLUETOOTH=yes PORT=/dev/ttyS1 SCRIPT=/etc/bluetooth/TIInit_3.2.26.bts SPEED='`[ -f "$BLUETOOTH_SCRIPT" ] && echo 921600 || echo 115200`' PROTO=texas PROBE=no ;; "HP iPAQ RX3000") BLUETOOTH=yes PORT=/dev/ttySAC0 SPEED=115200 PROTO=texas PROBE=no ;; *) BLUETOOTH=no ;; esac if [ $BLUETOOTH = "yes" ]; then stty -echo < $PORT if [ $PROBE = "yes" ]; then if ! blueprobe $PORT $SPEED; then BLUETOOTH=no fi fi fi echo $BLUETOOTH echo "BLUETOOTH=$BLUETOOTH" >/etc/sysconfig/bluetooth if [ $BLUETOOTH = "yes" ]; then echo "BLUETOOTH_PORT=$PORT" >>/etc/sysconfig/bluetooth if [ "$SCRIPT" != "" ]; then echo "BLUETOOTH_SCRIPT=$SCRIPT" >>/etc/sysconfig/bluetooth fi echo "BLUETOOTH_SPEED=$SPEED" >>/etc/sysconfig/bluetooth echo "BLUETOOTH_PROTOCOL=$PROTO" >>/etc/sysconfig/bluetooth fi fi