Mulla on tälläiset asetukset eri tiedostoissa: Oisko joku väärin?
/etc/bluetooth/hcid.conf
#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.7 2004/12/13 14:16:03 holtmann Exp $
#
# HCId options
options {
# Automatically initialize new devices
autoinit yes;
# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming connections
# user - Always ask user for a PIN
#
security user;
# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired devices
# once - Pair once and deny successive attempts
pairing multi;
# PIN helper
pin_helper /usr/bin/bluez-pin;
# D-Bus PIN helper
dbus_pin_helper;
}
# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
name "%h-%d";
# Local device class
class 0x3e0100;
# Default packet type
#pkt_type DH1,DM1,HV1;
# Inquiry and Page scan
iscan enable; pscan enable;
# Default link mode
# none - no specific policy
# accept - always accept incoming connections
# master - become master on incoming connections,
# deny role switch on outgoing connections
lm accept;
# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;
# Authentication and Encryption (Security Mode 3)
#auth enable;
#encrypt enable;
}
/etc/bluetooth/rfcomm.conf
#
# RFCOMM configuration file.
#
# $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $
#
# example:
#
rfcomm0
{
bind yes;
# Bluetooth address of the device
device 08:00:28:40:28:6C;
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "Motorola E770";
}
/etc/ppp/peers/bluetooth
# <tietokoneen ppp0-laitteen ip-osoite>:<kännykälle annettava ip-osoite>
# kannattaa olla eriverkosta kuin koneen eth laitteen/laitteiden ip(t).
10.0.4.100:10.0.4.101
115200
noauth
crtscts
ms-dns 10.0.1.1 # Dns palvelin
lock
/etc/ppp/ip-up.local
#!/bin/bash
. /etc/ppp/bluetooth-options
if [ "$IP_FORWARD" == yes ]; then
echo 1 > /proc/sys/net/ipv4/ip_forward
$IPT -t nat -A POSTROUTING -j SNAT -o $LAN --to $IP
fi
/etc/ppp/ip-down.local
#!/bin/bash
. /etc/ppp/bluetooth-options
if [ "$IP_FORWARD" == yes ]; then
echo 0 > /proc/sys/net/ipv4/ip_forward
$IPT -F -t nat
fi
/etc/ppp/bluetooth-options
IPT=/sbin/iptables
LAN=eth0
# Sallitaanko kännykän liikenteen välitys muuallekkin kuin tähän tietokoneeseen
IP_FORWARD=yes
# Parsitaan LAN interfacen ip-osoite ifconfigin tiedoista
IP=`ifconfig $LAN |grep "inet addr:" | awk -F " " '{print $2}'|awk -F ":" '{print $2}'`
/etc/init.d/bluez-utils
#! /bin/sh
#
# bluez-utils Bluetooth subsystem starting and stopping
#
# Edd Dumbill <ejad@debian.org>
#
# startup control over dund and pand can be changed by
# editing /etc/default/bluez-utils
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="Bluetooth services"
HCID=/usr/sbin/hcid
HCIATTACH=/usr/sbin/hciattach
HCID_NAME=hcid
HID2HCI=/usr/sbin/hid2hci
UART_CONF=/etc/bluetooth/uart
RFCOMM=/usr/bin/rfcomm
RFCOMM_NAME=rfcomm
RFCOMM_CONF=/etc/bluetooth/rfcomm.conf
SDPD=/usr/sbin/sdpd
SDPD_NAME=sdpd
DUND_DAEMON=/usr/bin/dund
DUND_NAME=dund
PAND_DAEMON=/usr/bin/pand
PAND_NAME=pand
HIDD_DAEMON=/usr/bin/hidd
HIDD_NAME=hidd
DUND_ENABLED=0
PAND_ENABLED=0
HIDD_ENABLED=0
DUND_OPTIONS=""
PAND_OPTIONS=""
HIDD_OPTIONS="--master --server"
test -f /etc/default/bluez-utils && . /etc/default/bluez-utils
test -f /etc/default/rcS && . /etc/default/rcS
. /lib/lsb/init-functions
# test for essential daemons
test -x $HCID || exit 0
test -x $HCIATTACH || exit 0
test -x $RFCOMM || exit 0
test -x $SDPD || exit 0
# disable nonessential daemons if not present
if test "$DUND_ENABLED" != "0"; then
if ! test -f $DUND_DAEMON; then
DUND_ENABLED=0
fi
fi
if test "$PAND_ENABLED" != "0"; then
if ! test -f $PAND_DAEMON; then
PAND_ENABLED=0
fi
fi
if test "$HIDD_ENABLED" != "0"; then
if ! test -f $HIDD_DAEMON; then
HIDD_ENABLED=0
fi
fi
set -e
enable_hci_input()
{
if [ "$VERBOSE" != no ]; then
log_success_msg "Switching on Bluetooth input devices..."
$HID2HCI --tohci
else
$HID2HCI --tohci >/dev/null 2>&1
fi
}
disable_hci_input()
{
if [ "$VERBOSE" != no ]; then
log_success_msg "Switching Bluetooth input devices back to HID mode..."
$HID2HCI --tohid
else
$HID2HCI --tohid >/dev/null 2>&1
fi
}
start_pan()
{
if test "$DUND_ENABLED" != "0"; then
sdptool add SP --channel=1
start-stop-daemon --start --quiet --exec $DUND_DAEMON -- $DUND_OPTIONS
[ "$VERBOSE" != no ] && log_success_msg "Starting $DUND_NAME..."
fi
if test "$PAND_ENABLED" != "0"; then
start-stop-daemon --start --quiet --exec $PAND_DAEMON -- $PAND_OPTIONS
[ "$VERBOSE" != no ] && log_success_msg "Starting $PAND_NAME..."
fi
}
stop_pan()
{
if test "$DUND_ENABLED" != "0"; then
start-stop-daemon --stop --quiet --exec $DUND_DAEMON || true
[ "$VERBOSE" != no ] && log_success_msg "Stopping $DUND_NAME..."
fi
if test "$PAND_ENABLED" != "0"; then
start-stop-daemon --stop --quiet --exec $PAND_DAEMON || true
[ "$VERBOSE" != no ] && log_success_msg "Stopping $PAND_NAME..."
fi
}
start_hid()
{
if test "$HIDD_ENABLED" != "0"; then
start-stop-daemon --start --quiet --exec $HIDD_DAEMON -- $HIDD_OPTIONS
[ "$VERBOSE" != no ] && log_success_msg "Starting $HIDD_NAME..."
fi
}
stop_hid()
{
if test "$HIDD_ENABLED" != "0"; then
$HIDD_DAEMON --killall
start-stop-daemon --stop --quiet --exec $HIDD_DAEMON || true
[ "$VERBOSE" != no ] && log_success_msg "Stopping $HIDD_NAME..."
fi
}
start_uarts()
{
[ -f $HCIATTACH ] && [ -f $UART_CONF ] || return
grep -v '^#' $UART_CONF | while read i; do
if [ "$VERBOSE" != no ]; then
$HCIATTACH $i
else
$HCIATTACH $i >/dev/null 2>&1
fi
done
}
stop_uarts()
{
killall hciattach > /dev/null 2>&1 || true
}
start_rfcomm()
{
if [ -x $RFCOMM ] && [ -f $RFCOMM_CONF ] ; then
# rfcomm must always succeed for now: users
# may not yet have an rfcomm-enabled kernel
if [ "$VERBOSE" != no ]; then
log_success_msg "Starting $RFCOMM_NAME..."
$RFCOMM -f $RFCOMM_CONF bind all || true
else
$RFCOMM -f $RFCOMM_CONF bind all >/dev/null 2>&1 || true
fi
fi
}
stop_rfcomm()
{
if [ -x $RFCOMM ] ; then
if [ "$VERBOSE" != no ]; then
log_success_msg "Stopping $RFCOMM_NAME..."
$RFCOMM unbind all || true
else
$RFCOMM unbind all >/dev/null 2>&1 || true
fi
fi
}
restart_rfcomm()
{
if [ -x $RFCOMM ] && [ -f $RFCOMM_CONF ] ; then
if [ "$VERBOSE" != no ]; then
log_success_msg "Restarting $RFCOMM_NAME..."
$RFCOMM unbind all || true
$RFCOMM -f $RFCOMM_CONF bind all || true
else
$RFCOMM unbind all >/dev/null 2>&1|| true
$RFCOMM -f $RFCOMM_CONF bind all >/dev/null 2>&1 || true
fi
fi
}
case "$1" in
start)
log_begin_msg "Starting $DESC..."
start-stop-daemon --start --quiet --exec $HCID || true
echo -n " $HCID_NAME"
start_uarts || true
start-stop-daemon --start --quiet --exec $SDPD || true
echo -n " $SDPD_NAME"
start_hid || true
# enable_hci_input || true
start_rfcomm || true
start_pan || true
log_end_msg 0
;;
stop)
log_begin_msg "Stopping $DESC..."
stop_pan || true
stop_rfcomm || true
# disable_hci_input || true
stop_hid || true
start-stop-daemon --stop --quiet --exec $SDPD || true
echo -n " $SDPD_NAME"
start-stop-daemon --stop --quiet --exec $HCID || true
echo -n " $HCID_NAME"
stop_uarts || true
log_end_msg 0
;;
restart|force-reload)
log_begin_msg "Restarting $DESC..."
stop_hid || true
stop_pan || true
start-stop-daemon --stop --quiet --exec $SDPD || true
start-stop-daemon --stop --quiet --exec $HCID || true
sleep 1
start-stop-daemon --start --quiet --exec $HCID || true
start-stop-daemon --start --quiet --exec $SDPD || true
start_pan || true
start_hid || true
restart_rfcomm
log_end_msg 0
;;
*)
N=/etc/init.d/bluez-utils
log_success_msg "Usage: $N {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
/etc/default/bluez-utils
# Defaults for bluez-utils
# This file supersedes /etc/default/bluez-pan. If
# that exists on your system, you should use this
# file instead and remove the old one. Until you
# do so, the contents of this file will be ignored.
############ HIDD
#
# To have Bluetooth mouse and keyboard support, get the
# Linux 2.6.6 patch or better from bluez.org, and set
# HIDD_ENABLED to 1.
HIDD_ENABLED=0
HIDD_OPTIONS="--master --server"
# to make hidd always use a particular interface, use something
# like this, substituting the bdaddr of the interface:
# HIDD_OPTIONS="-i AA:BB:CC:DD:EE:FF --server"
#
# remove '--master' if you're having trouble working with Ericsson
# T630 phones with hidd operational at the same time.
############ COMPATIBILITY WITH OLD BLUEZ-PAN
# Compatibility: if old PAN config exists, use it
# rather than this file.
if test -f /etc/default/bluez-pan; then
. /etc/default/bluez-pan
return
fi
############
############ DUND
#
# Run dund -- this allows ppp logins. 1 for enabled, 0 for disabled.
DUND_ENABLED=1
# Arguments to dund: defaults to acting as a server
DUND_OPTIONS="--listen call bluetooth --channel=1"
# Run dund --help to see the full array of options.
# Here are some examples:
#
# Connect to any nearby host offering access
# DUND_OPTIONS="--search"
#
# Connect to host 00:11:22:33:44:55
# DUND_OPTIONS="--connect 00:11:22:33:44:55"
#
# Listen on channel 3
# DUND_OPTIONS="--listen --channel 3"
# Special consideration is needed for certain devices. Microsoft
# users see the --msdun option. Ericsson P800 users will need to
# listen on channel 3 and also run 'sdptool add --channel=3 SP'
############ PAND
#
# Run pand -- ethernet: creates new network interfaces bnep<N>
# that can be configured in /etc/network/interfaces
# set to 1 for enabled, 0 for disabled
PAND_ENABLED=0
# Arguments to pand
# Read the PAN howto for ways to set this up
#
http://bluez.sourceforge.net/contrib/HOWTO-PANPAND_OPTIONS=""
# example pand lines
#
# Act as the controller of an ad-hoc network
# PAND_OPTIONS="--listen --role GN"
#
# Act as a network access point: routes to other networks
# PAND_OPTIONS="--listen --role NAP"
#
# Act as a client of an ad-hoc controller with number 00:11:22:33:44:55
# PAND_OPTIONS="--role PANU --connect 00:11:22:33:44:55"
#
# Connect to any nearby network controller (access point or ad-hoc)
# PAND_OPTIONS="--role PANU --search"
juha@Juhankannettava:~$ sudo hcitool info 08:00:28:40:28:6C
Password:
Requesting information ...
BD Address: 08:00:28:40:28:6C
Device Name: Motorola E770
LMP Version: 2.0 (0x3) LMP Subversion: 0xe1b
Manufacturer: Texas Instruments Inc. (13)
Features: 0xff 0xff 0x2d 0x78 0x18 0x18 0x00 0x80
<3-slot packets> <5-slot packets> <encryption> <slot offset>
<timing accuracy> <role switch> <hold mode> <sniff mode>
<park state> <RSSI> <channel quality> <SCO link> <HV2 packets>
<HV3 packets> <u-law log> <A-law log> <CVSD> <power control>
<transparent SCO> <enhanced iscan> <interlaced iscan>
<interlaced pscan> <inquiry with RSSI> <AFH cap. slave>
<AFH class. slave> <AFH cap. master> <AFH class. master>
<extended features>
juha@Juhankannettava:~$ hcitool scan
Scanning ...
08:00:28:40:28:6C Motorola E770