Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Mar 2003 19:58:36 -0800
From:      "Maksim Yevmenkin" <Maksim.Yevmenkin@cw.com>
To:        "Pav Lucistnik" <pav@oook.cz>
Cc:        <freebsd-mobile@freebsd.org>
Subject:   RE: Anycom bluetooth progress
Message-ID:  <790A8B1F40ACA848939EBD247AE490302794E7@scl8ex04.int.exodus.net>

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

> > > I noticed there is no rc.bluetooth in march tarball, so I reused =
it and
> > userland tools from february tarball.
> >=20
> > oops my fault. i have uploaded updated tarball at the same location.
> > please DO NOT use old userspace and new kernel. this WILL NOT work.
> > you should
> >=20
> > 1) download new tarball
> > 2) update haders /usr/include/netgraph/bluetooth/include
> > 3) build and install new kernel and userspace (usr.{s}bin)/bluetooth
>=20
> Done. Now l2ping works for me.

good=20
=20
> How do I make dialup over my phone? I tried
>=20
> # rfcomm_pppd -a 00:80:37:29:19:a4 -c -C 1 -d -l rfcomm-dialup
> rfcomm_pppd[1787]: Could not connect socket. Connection refused (61)

this is correct if your phone BDADDR is 00:80:37:29:19:a4 and it
provides DUN service of RFCOMM channel 1. you can find out which
RFCOMM channel has DUN service via

# sdptool browse 00:80:37:29:19:a4 (your phone BDADDR)

> # hcidump -x
> HCIDump - HCI packet analyzer ver 1.4
> device: any snap_len: 65535 filter: 0xffffffff
> < ACL data: handle 0x0029 flags 0x02 dlen 12
>     L2CAP(s): Connect req: psm 3 scid 0x0043
> > HCI Event: Number of Completed Packets(0x13) plen 5
>   01 29 00 01 00=20
> > ACL data: handle 0x0029 flags 0x02 dlen 16
>     L2CAP(s): Connect rsp: dcid 0x0041 scid 0x0043 result 0 status 0

l2cap connection has been established.

> < ACL data: handle 0x0029 flags 0x02 dlen 16
>     L2CAP(s): Config req: dcid 0x0041 flags 0x0000 clen 4
> >     MTU 132=20
> > HCI Event: Number of Completed Packets(0x13) plen 5
>   01 29 00 01 00=20
> > ACL data: handle 0x0029 flags 0x02 dlen 17
> > ACL data: handle 0x0029 flags 0x01 dlen 1
>     L2CAP(s): Config rsp: scid 0x0043 flags 0x0000 result 0 clen 4
>     MTU 132=20
> > ACL data: handle 0x0029 flags 0x02 dlen 16
>     L2CAP(s): Config req: dcid 0x0043 flags 0x0000 clen 4
>     MTU 132=20
> < ACL data: handle 0x0029 flags 0x02 dlen 14
>     L2CAP(s): Config rsp: scid 0x0041 flags 0x0000 result 0 clen 0

l2cap channel has been configured with MTU of 132 bytes. good

> < ACL data: handle 0x0029 flags 0x02 dlen 8
>     L2CAP(d): cid 0x41 len 4 [psm 3]
>       RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c=20
> > HCI Event: Number of Completed Packets(0x13) plen 5
>   01 29 00 01 00=20
> > HCI Event: Number of Completed Packets(0x13) plen 5
>   01 29 00 01 00=20
> > ACL data: handle 0x0029 flags 0x02 dlen 8
>     L2CAP(d): cid 0x43 len 4 [psm 3]
>       RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7=20

here we open (SABM) RFCOMM multiplexor channel (DLCI 0) and=20
your phone seems to agree to open it (UA). no problem here.

> < ACL data: handle 0x0029 flags 0x02 dlen 18
>     L2CAP(d): cid 0x41 len 14 [psm 3]
>       RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8
>       dlci 2 frame_type 0 credit_flow 15 pri 0 ack_timer 0 frame_size
> 127 max_retrans 0 credits 7
> > HCI Event: Number of Completed Packets(0x13) plen 5
>   01 29 00 01 00=20
> > ACL data: handle 0x0029 flags 0x02 dlen 17
> > ACL data: handle 0x0029 flags 0x01 dlen 2
>     L2CAP(d): cid 0x43 len 15 [psm 3]
>       RFCOMM(s): PN RSP: cr 0 dlci 0 pf 0 ilen 10 fcs 0xaa mcc_len 8
>       dlci 2 frame_type 0 credit_flow 0 pri 7 ack_timer 0 frame_size =
127
> max_retrans 0 credits 0

here we try to configure (PN) DLCI 2 (RFCOMM channel 1 on non-initiated
connection device). we try to turn off credit based flow control and set
RFCOMM MTU to 127 bytes. your phone rejects our credit flow control
proposal (not a big problem - probably your phone has older Bluetooth =
1.0b
RFCOMM implementation), but agrees to set RFCOMM MTU to 127 bytes. =
nothing
unusual here, except reject for the credit based flow contol.

> < ACL data: handle 0x0029 flags 0x02 dlen 8
>     L2CAP(d): cid 0x41 len 4 [psm 3]
>       RFCOMM(s): SABM: cr 1 dlci 2 pf 1 ilen 0 fcs 0x59=20
> > HCI Event: Number of Completed Packets(0x13) plen 5
>   01 29 00 01 00=20
> > ACL data: handle 0x0029 flags 0x02 dlen 8
>     L2CAP(d): cid 0x43 len 4 [psm 3]
>       RFCOMM(s): DM: cr 1 dlci 2 pf 1 ilen 0 fcs 0x73=20

we proceed and try to actually open (SABM) DLCI 2 (RFCOMM channel 1 on
non-initiated connection device). and your phone sends us back a DM
(Disconnecting Mode) and rejects it! weird - up until this point
everything was fine.

what are security settings on the phone? i did not notice any PIN/KEY
request messages? does manual says anything about it?

> < ACL data: handle 0x0029 flags 0x02 dlen 8
>    L2CAP(d): cid 0x41 len 4 [psm 3]
>      RFCOMM(s): DISC: cr 1 dlci 0 pf 1 ilen 0 fcs 0xfd=20
> > HCI Event: Number of Completed Packets(0x13) plen 5
>  01 29 00 01 00=20
> > ACL data: handle 0x0029 flags 0x02 dlen 8
>    L2CAP(d): cid 0x43 len 4 [psm 3]
>      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7=20

and of course we disconnect (DISC) RFCOMM multiplexor channel (DCLI 0)
and your phone agees to disconnect it (UA).

> < ACL data: handle 0x0029 flags 0x02 dlen 12
>     L2CAP(s): Disconn req: dcid 0x0041 scid 0x0043
> > HCI Event: Number of Completed Packets(0x13) plen 5
>   01 29 00 01 00=20
> > ACL data: handle 0x0029 flags 0x02 dlen 12
>    L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x0043

... and we disconnect l2cap channel. we are done.

> I suppose phone refused connection because it's not paired with my
> computer. I had to pair my Palm handheld with phone when I used it.

it could be, but i would expect to see it at connection setup time.

> I found hcsecd, read it's manpage, added this to
> /usr/local/etc/hcsecd.conf:
>
> device {
>        bdaddr  00:80:37:29:19:a4;
>        name    "Pavi T39";
>        key     nokey;
>        pin     "1234";
> }

this looks good. it says:

1) when i receive key request for the device 00:80:37:29:19:a4
   i shell send no key back.=20
2) when i receive pin request for the device 00:80:37:29:19:a4
   i shell send "1234" as pin

> and started hcsecd. Tried pairing on phone, using code "1234". Pairing
> failed, hcsecd's output was silent, here is hcidump:
>
> > HCI Event: Connect Request(0x04) plen 10
>   A4 19 29 37 80 00 04 02 52 01=20
> < HCI Command: Accept Connection Request(0x01|0x0009) plen 7
>   A4 19 29 37 80 00 00=20
> > HCI Event: Command Status(0x0f) plen 4
>   00 01 09 04=20
> > HCI Event: Connect Complete(0x03) plen 11
>   1A 29 00 A4 19 29 37 80 00 01 00=20

aha. in this case you have your *phone* acting as a client right?
i.e. you actually told your phone to connect to your PC. you see
by default Bluetooth devices do not require authentication. so when
your phone tries to connect to your PC we just respond - go ahead
its open :) now, in order to request authentication for the incomming
connections you have to=20

# hccontrol -n ubt0hci Read_Authentication_Enable
# hccontrol -n ubt0hci Write_Authentication_Enable 1

> What now?

1) make sure there are no open beseband connection,

 # hccontrol -n ubt0hci read_connection_list

2) if there are any connections - disconnect them

 # hccontrol -n ubt0hci disconnect <connection_handle>

3) enable authentication for the incoming connection
=20
 # hccontrol -n ubt0hci write_authentication_enable 1

4) start hcsed

5) use your phone and try to connect to your PC

you should be able to pair with your phone now. after you add
your PC to the list of paired devices you might want to try
and open RFCOMM connection again - just like you did before.

thanks,
max


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




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