Acer 3400LMI User Manual

Size:
756.04 Kb
Download

F8­x86_64 on the Acer Ferrari 3400LMi

internal) internal

;;

tv)

tvout

;;

*)

usage

;;

esac

51

F8­x86_64 on the Acer Ferrari 3400LMi

Appendix C – dun­bind.sh

#!/bin/sh

#

#Available at http://ferrari.databa.se/3400/f8/dun­bind.sh

#A verbose sample script for finding the Dial Up Networking

#channel on a Bluetooth device and binding a /dev/rfcomm port to it.

#By Sven­Göran Bergh, 2005­11­03

#Update 2007­04­03 Added release of passive/closed rfcomm port.

#

#Use this /dev/rfcomm port RFPORT=1

#Name of Bluetooth device to bind to: BTNAME="S­Gs P900"

success() {

echo ­e $"\\033[60G[ \\033[1;32mOK\\033[0;39m ]" return 0

}

failure() {

echo ­e $"\\033[60G[\\033[1;31mFAILED\\033[0;39m]" exit 1

}

#Check that local Bluetooth device is active echo ­n $"Checking for local Bluetooth device..." hciconfig | grep 'UP RUNNING' &> /dev/null \

&&success || failure

#If the rfcomm port exists but is currently not in use, try to release

it

if [ "`rfcomm show ${RFPORT} 2> /dev/null | awk ­­ '{print $5}'`" == "closed" ];

then

echo ­n $"Trying to free closed port /dev/rfcomm${RFPORT}..."

rfcomm release ${RFPORT} &> /dev/null \ && success || failure

fi

# Check if the rfcomm port is free

echo ­n $"Checking that /dev/rfcomm${RFPORT} is free..." rfcomm show ${RFPORT} &> /dev/null \

&&failure || success

#Check for the remote Bluetooth device

52

F8­x86_64 on the Acer Ferrari 3400LMi

echo ­n $"Searching for remote Bluetooth device ${BTNAME}..." BTADDR=`hcitool scan | grep "${BTNAME}" | awk ­­ '{print $1}'` [ "${BTADDR}" ] && success || failure

# Find the Dial Up Networking channel

echo ­n $"Searching for Dial Up Networking service..." DUN=`sdptool search ­­bdaddr ${BTADDR} DUN \

| awk ­­ '/Channel/ {print $2}'` [ "${DUN}" ] && success || failure

# Bind the rfcomm port to the DUN channel

echo ­n $"Binding /dev/rfcomm${RFPORT} to DUN channel ${DUN}..." rfcomm bind ${RFPORT} ${BTADDR} ${DUN} \

&& success || failure

53

F8­x86_64 on the Acer Ferrari 3400LMi

Appendix D /etc/init.d/slmodemd

#!/bin/sh

#

#Available at http://ferrari.databa.se/3400/f8/slmodemd­sysv­init.sh

#Use slmodemd­sysv­init.sh install to install it.

#

# slmodemd: Starts the SmartLink Modem Daemon

#

#chkconfig: 345 90 10

#description: This is the user space part of the SmartLink Modem driver

#processname: slmodemd

# config: /etc/sysconfig/slmodemd

# Source function library.

. /etc/init.d/functions

PROG=slmodemd

RETVAL=0

#Default configuration SLMODEMD_DEVICE= SLMODEMD_OPTS= SLMODEMD_COUNTRY=SWEDEN USE_ALSA="yes"

#Source configuration CONFIG=/etc/sysconfig/${PROG} if [ ­f $CONFIG ]; then

. $CONFIG

#override default group and permissions if defined in $CONFIG;

#other valid options also can be put into SLMODEMD_OPTS variable

["$GROUP" ] \

&&SLMODEMD_OPTS="$SLMODEMD_OPTS ­­group=$GROUP"

["$PERMS" ] \

&&SLMODEMD_OPTS="$SLMODEMD_OPTS ­­perm=$PERMS"

fi

# Do not try to start on a kernel which does not support it if [ $USE_ALSA != "yes" ]; then

grep ­q 'slamr\.o' /lib/modules/`uname ­r`/modules.dep || exit 0

fi

if [ $USE_ALSA = "yes" ]; then SLMODEMD_OPTS="$SLMODEMD_OPTS ­­alsa"

else

SLMODEMD_OPTS="$SLMODEMD_OPTS $SLMODEMD_DEVICE"

fi

start() {

54

F8­x86_64 on the Acer Ferrari 3400LMi

echo ­n "Starting SmartLink Modem driver: "

${PROG} ­­country=$SLMODEMD_COUNTRY $SLMODEMD_OPTS 2>&1 \ | logger ­t ${PROG} &

PID=`pidof ${PROG}` RETVAL=$?

[$RETVAL ­eq 0 ] \

&&success $"${PROG} startup" \

|| failure $"${PROG} startup"

echo

[$RETVAL ­eq 0 ] \

&&touch /var/lock/subsys/${PROG} return $RETVAL

}

stop() {

echo ­n "Shutting down SmartLink Modem driver: " killproc ${PROG}

RETVAL=$?

[ $RETVAL ­eq 0 ] && rm ­f /var/lock/subsys/${PROG} echo

return $RETVAL

}

# See how we were called. case "$1" in

start) start

;;

stop) stop

;;

status)

status ${PROG} RETVAL=$?

;;

restart|reload) stop

start RETVAL=$?

;;

condrestart)

if [ ­f /var/lock/subsys/${PROG} ]; then stop

start RETVAL=$?

fi

;;

install)

install ­t ­m 755 $0 /etc/init.d/${PROG} &> /dev/null chkconfig ­­add ${PROG}

;;

*)

55

F8­x86_64 on the Acer Ferrari 3400LMi

echo "Usage: ${PROG} {start|stop|status|restart|condrestart| install}"

exit 1

esac

exit $RETVAL

56