Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2007 23:36:59 +0400
From:      Vladimir Grebenschikov <vova@sw.ru>
To:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
Cc:        bluetooth <bluetooth@freebsd.org>
Subject:   Re: Bluetooth Proximity Monitor on FreeBSD ?
Message-ID:  <1179344219.1498.20.camel@localhost>
In-Reply-To: <bb4a86c70705161226v7274e505x6c6e2ddf29805aa3@mail.gmail.com>
References:  <1179237283.1397.25.camel@localhost> <464A8EFC.7060308@freebsd.org> <1179304640.45992.8.camel@localhost> <bb4a86c70705160945j3ab47faase4bdb197e812460d@mail.gmail.com> <1179336829.1498.9.camel@localhost> <bb4a86c70705161226v7274e505x6c6e2ddf29805aa3@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
=F7 =D3=D2, 16/05/2007 =D7 12:26 -0700, Maksim Yevmenkin =D0=C9=DB=C5=D4:
> On 5/16/07, Vladimir Grebenschikov <vova@sw.ru> wrote:
> > =F7 =D3=D2, 16/05/2007 =D7 09:45 -0700, Maksim Yevmenkin =D0=C9=DB=C5=
=D4:
> >
> > > > Connection expires somehow in ~5 secs after creation.
> > > > Probably there is some way to do keep-alive connection ?
> > > >
> > > > My device is Nokia E60.
> > >
> > > run hcidump and see who initiated disconnect. my guess, its your noki=
a
> > > phone kills baseband after some period of inactivity. if that is the
> > > case then you have to use l2ping or something else. the idea is to
> > > keep sending stuff over baseband connection to keep it alive.
> >
> > Hm, l2ping does not helps (output just after connecting):
> > # l2ping -a e60
> > 0 bytes from e60 seq_no=3D0 time=3D65.077 ms result=3D0
> > 0 bytes from e60 seq_no=3D1 time=3D52.096 ms result=3D0
> > 0 bytes from e60 seq_no=3D2 time=3D54.053 ms result=3D0
> > 0 bytes from e60 seq_no=3D3 time=3D42.082 ms result=3D0
> > 0 bytes from e60 seq_no=3D4 time=3D42.151 ms result=3D0
> > 0 bytes from e60 seq_no=3D5 time=3D5129.224 ms result=3D0x4  <<< connec=
tion
> > lost here
> > ...
>=20
> well, that is just weird. while zero bytes response is normal (for
> nokia's), killing baseband connection while l2ping (in other words
> l2cap control channel) is active, is just does not make any sense. can
> you provide hcidump with l2ping active? i'd like to see who is killing
> baseband.

# hcidump -xt
HCIDump - HCI packet analyzer ver 1.5
device: any snap_len: 65535 filter: 0xffffffff
1179344009.007333 < HCI Command: Create Connection(0x01|0x0005) plen 13
  36 E3 48 D1 12 00 18 CC 00 00 00 00 01=20
1179344009.010333 > HCI Event: Command Status(0x0f) plen 4
  00 01 05 04=20
1179344009.744420 > HCI Event: Connect Complete(0x03) plen 11
  00 0B 00 36 E3 48 D1 12 00 01 00=20
1179344009.744434 < HCI Command: Write Link Policy Settings(0x02|0x000d)
plen 4
  0B 00 0F 00=20
1179344009.744443 < ACL data: handle 0x000b flags 0x02 dlen 52
    L2CAP(s): Echo req: dlen 44
    00 00 00 00 35 36 37 38 39 30 2D 31 32 33 34 35 36 37 38 39=20
    30 2D 31 32 33 34 35 36 37 38 39 30 2D 31 32 33 34 35 36 37=20
    38 39 30 2D=20
1179344009.745326 > HCI Event: Command Complete(0x0e) plen 6
  01 0D 08 00 0B 00=20
1179344009.766310 > HCI Event: Max Slots Change(0x1b) plen 3
  0B 00 05=20
1179344009.890323 > ACL data: handle 0x000b flags 0x02 dlen 8
    L2CAP(s): Echo rsp: dlen 0
1179344009.896345 > HCI Event: Number of Completed Packets(0x13) plen 5
  01 0B 00 01 00=20
1179344010.891077 < ACL data: handle 0x000b flags 0x02 dlen 52
    L2CAP(s): Echo req: dlen 44
    00 00 00 01 35 36 37 38 39 30 2D 31 32 33 34 35 36 37 38 39=20
    30 2D 31 32 33 34 35 36 37 38 39 30 2D 31 32 33 34 35 36 37=20
    38 39 30 2D=20
1179344010.951285 > ACL data: handle 0x000b flags 0x02 dlen 8
    L2CAP(s): Echo rsp: dlen 0
1179344011.133469 < HCI Command: Create Connection(0x01|0x0005) plen 13
  36 E3 48 D1 12 00 18 4C 00 00 00 00 01=20
1179344011.134318 > HCI Event: Command Status(0x0f) plen 4
  0B 01 05 04=20
1179344011.145286 > HCI Event: Number of Completed Packets(0x13) plen 5
  01 0B 00 01 00=20
1179344011.952045 < ACL data: handle 0x000b flags 0x02 dlen 52
    L2CAP(s): Echo req: dlen 44
    00 00 00 02 35 36 37 38 39 30 2D 31 32 33 34 35 36 37 38 39=20
    30 2D 31 32 33 34 35 36 37 38 39 30 2D 31 32 33 34 35 36 37=20
    38 39 30 2D=20
1179344012.008275 > ACL data: handle 0x000b flags 0x02 dlen 8
    L2CAP(s): Echo rsp: dlen 0
1179344012.145298 > HCI Event: Number of Completed Packets(0x13) plen 5
  01 0B 00 01 00=20
1179344013.009054 < ACL data: handle 0x000b flags 0x02 dlen 52
    L2CAP(s): Echo req: dlen 44
    00 00 00 03 35 36 37 38 39 30 2D 31 32 33 34 35 36 37 38 39=20
    30 2D 31 32 33 34 35 36 37 38 39 30 2D 31 32 33 34 35 36 37=20
    38 39 30 2D=20
1179344013.071313 > ACL data: handle 0x000b flags 0x02 dlen 8
    L2CAP(s): Echo rsp: dlen 0
1179344013.270323 > HCI Event: Number of Completed Packets(0x13) plen 5
  01 0B 00 01 00=20
1179344014.072079 < ACL data: handle 0x000b flags 0x02 dlen 52
    L2CAP(s): Echo req: dlen 44
    00 00 00 04 35 36 37 38 39 30 2D 31 32 33 34 35 36 37 38 39=20
    30 2D 31 32 33 34 35 36 37 38 39 30 2D 31 32 33 34 35 36 37=20
    38 39 30 2D=20
1179344014.135304 > ACL data: handle 0x000b flags 0x02 dlen 8
    L2CAP(s): Echo rsp: dlen 0
1179344014.270322 > HCI Event: Number of Completed Packets(0x13) plen 5
  01 0B 00 01 00=20
1179344015.058336 > HCI Event: Disconn Complete(0x05) plen 4
  00 0B 00 13=20
1179344015.136021 < HCI Command: Create Connection(0x01|0x0005) plen 13
  36 E3 48 D1 12 00 18 CC 00 00 00 00 01=20
1179344015.137302 > HCI Event: Command Status(0x0f) plen 4
  00 01 05 04=20
1179344020.265307 > HCI Event: Connect Complete(0x03) plen 11
  04 0B 00 36 E3 48 D1 12 00 01 00=20
1179344021.266433 < HCI Command: Create Connection(0x01|0x0005) plen 13
  36 E3 48 D1 12 00 18 CC 00 00 00 00 01=20
1179344021.268281 > HCI Event: Command Status(0x0f) plen 4
  00 01 05 04=20
1179344022.535338 > HCI Event: Connect Complete(0x03) plen 11
  00 0B 00 36 E3 48 D1 12 00 01 00=20
1179344022.535348 < HCI Command: Write Link Policy Settings(0x02|0x000d)
plen 4
  0B 00 0F 00=20
1179344022.535363 < ACL data: handle 0x000b flags 0x02 dlen 52
    L2CAP(s): Echo req: dlen 44
    00 00 00 06 35 36 37 38 39 30 2D 31 32 33 34 35 36 37 38 39=20
    30 2D 31 32 33 34 35 36 37 38 39 30 2D 31 32 33 34 35 36 37=20
    38 39 30 2D=20
1179344022.538258 > HCI Event: Command Complete(0x0e) plen 6
  01 0D 08 00 0B 00=20
1179344022.558262 > HCI Event: Max Slots Change(0x1b) plen 3
  0B 00 05=20
1179344022.705290 > ACL data: handle 0x000b flags 0x02 dlen 8
    L2CAP(s): Echo rsp: dlen 0
1179344022.770280 > HCI Event: Number of Completed Packets(0x13) plen 5
  01 0B 00 01 00=20
1179344023.706407 < ACL data: handle 0x000b flags 0x02 dlen 52
    L2CAP(s): Echo req: dlen 44
    00 00 00 07 35 36 37 38 39 30 2D 31 32 33 34 35 36 37 38 39=20
    30 2D 31 32 33 34 35 36 37 38 39 30 2D 31 32 33 34 35 36 37=20
    38 39 30 2D=20
1179344023.763282 > ACL data: handle 0x000b flags 0x02 dlen 8
    L2CAP(s): Echo rsp: dlen 0
1179344023.895291 > HCI Event: Number of Completed Packets(0x13) plen 5
  01 0B 00 01 00=20
^C


> btw, but if you let l2ping to continue to run it should re-establish
> baseband connection again.

Yes, every ~5s it timeouts and then it re-establish connection and then
gets several replays with usual delay

# /usr/sbin/hccontrol -n ubt0hci read_connection_list
Remote BD_ADDR    Handle Type Mode Role Encrypt Pending Queue State
e60                 3869  ACL    0 MAST    NONE       0     0
W4_CONN_COMPLETE

...
0 bytes from e60 seq_no=3D47 time=3D1162.826 ms result=3D0=20
0 bytes from e60 seq_no=3D48 time=3D68.149 ms result=3D0=20
0 bytes from e60 seq_no=3D49 time=3D45.690 ms result=3D0=20
0 bytes from e60 seq_no=3D50 time=3D50.061 ms result=3D0=20
0 bytes from e60 seq_no=3D51 time=3D65.745 ms result=3D0=20
0 bytes from e60 seq_no=3D52 time=3D1142.827 ms result=3D0=20
0 bytes from e60 seq_no=3D53 time=3D62.854 ms result=3D0=20
0 bytes from e60 seq_no=3D54 time=3D42.855 ms result=3D0=20
0 bytes from e60 seq_no=3D55 time=3D58.678 ms result=3D0=20
0 bytes from e60 seq_no=3D56 time=3D51.960 ms result=3D0=20
0 bytes from e60 seq_no=3D57 time=3D1183.973 ms result=3D0=20
0 bytes from e60 seq_no=3D58 time=3D57.024 ms result=3D0=20
0 bytes from e60 seq_no=3D59 time=3D55.461 ms result=3D0=20
0 bytes from e60 seq_no=3D60 time=3D58.316 ms result=3D0=20
0 bytes from e60 seq_no=3D61 time=3D42.456 ms result=3D0=20
0 bytes from e60 seq_no=3D62 time=3D5129.594 ms result=3D0x4=20
0 bytes from e60 seq_no=3D63 time=3D1497.149 ms result=3D0=20
...

> yep, it seems like nokia kills baseband :(

Any hint how encourage it to keep connection ?

> thanks,
> max
>=20
--=20
Vladimir B. Grebenschikov
SWsoft Inc. vova@swsoft.com



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