Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 2008 17:29:39 -0700
From:      "Maksim Yevmenkin" <maksim.yevmenkin@gmail.com>
To:        mato <gamato@users.sf.net>
Subject:   Re: BT issues
Message-ID:  <bb4a86c70803161729y51f376d0t8333c30713c646d6@mail.gmail.com>
In-Reply-To: <47DBE7A4.3060006@users.sf.net>
References:  <47DBE7A4.3060006@users.sf.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello,

>  I've got two questions regarding bluetooth in FreeBSD:
>
>  1)  I'd like to start rfcomm_pppd automatically upon connecting my BT
> dongle.  I know about /etc/devd.conf but from my understanding only one
> action takes place and there's already action for ubt device and so I don't
> know how to trigger my script.

you do not really have to do it. you can run rfcomm_pppd even if no
bluetooth devices are connected to the system. basically, all you need
to do is to run both sdpd and rfcomm_pppd bound to wildcard (aka ANY)
bd_addr.

1) to enable sdpd at boot time just add to your /etc/rc.conf the following line

sdpd_enanble="YES"

this should start sdpd on boot automatically. to start/stop sdpd at run time use

/etc/rc.d/sdpd start/stop

2) please cut and paste the following rc script into
/etc/rc.d/rfcomm_pppd_server

==

#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: rfcomm_pppd_server
# REQUIRE: DAEMON sdpd
# BEFORE: LOGIN
# KEYWORD: nojail

. /etc/rc.subr

name="rfcomm_pppd_server"
rcvar=`set_rcvar`
command="/usr/sbin/rfcomm_pppd"
command_args="-s"
start_precmd="rfcomm_pppd_server_prestart"
required_modules="ng_btsocket"

rfcomm_pppd_server_prestart()
{
        if [ -n "${rfcomm_pppd_server_bd_addr}" ]; then
                command_args="${command_args} -a ${rfcomm_pppd_server_bd_addr}"
        fi

        command_args="${command_args} -C ${rfcomm_pppd_server_channel:-1}"

        command_args="${command_args} -l
${rfcomm_pppd_server_label:-rfcomm-server}"

        if checkyesno rfcomm_pppd_server_register_sp ; then
                command_args="${command_args} -S"
        fi

        if checkyesno rfcomm_pppd_server_register_dun ; then
                command_args="${command_args} -D"
        fi
}

load_rc_config $name
run_rc_command "$1"

==

3) to enable rfcomm_pppd server at boot time just add to your
/etc/rc.conf the following line

rfcomm_pppd_server_enanble="YES"
rfcomm_pppd_server_channel=1  # EDIT THIS IF NEEDED
rfcomm_pppd_server_label="rfcomm-server" # EDIT THIS IF NEEDED
rfcomm_pppd_server_register_sp="NO"
rfcomm_pppd_server_register_dun="NO"

this should start rfcomm_pppd server on boot automatically. to
start/stop rfcomm_pppd server at run time use

/etc/rc.d/rfcomm_pppd start/stop

>  2)  I've got two ppp.conf profiles, one for FreeBSD and one for Windows.
> When I connect FreeBSD laptop via rfcomm_pppd it works and caches the hcsec
> key.  But if I try to connect Windows machine, it asks for password and it
> seems the key is changed as from that time I cannot connect FreeBSD machine
> and I have to remove hcsecd.keys and restart hcsecd.  Why and what can be
> done about it ?

I'm not really sure what are you trying to do. before giving any
suggestions, i'd like to see hcsecd.conf and hcidump that shows the
problem with authentication.

thanks,
max

p.s. please keep freebsd-bluetooth@ in the cc list



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb4a86c70803161729y51f376d0t8333c30713c646d6>