Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2007 21:33:49 +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:  <1179336829.1498.9.camel@localhost>
In-Reply-To: <bb4a86c70705160945j3ab47faase4bdb197e812460d@mail.gmail.com>
References:  <1179237283.1397.25.camel@localhost> <464A8EFC.7060308@freebsd.org> <1179304640.45992.8.camel@localhost> <bb4a86c70705160945j3ab47faase4bdb197e812460d@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
=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.
>=20
> run hcidump and see who initiated disconnect. my guess, its your nokia
> 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=20
0 bytes from e60 seq_no=3D1 time=3D52.096 ms result=3D0=20
0 bytes from e60 seq_no=3D2 time=3D54.053 ms result=3D0=20
0 bytes from e60 seq_no=3D3 time=3D42.082 ms result=3D0=20
0 bytes from e60 seq_no=3D4 time=3D42.151 ms result=3D0=20
0 bytes from e60 seq_no=3D5 time=3D5129.224 ms result=3D0x4  <<< connection
lost here=20
...


hcidump (without l2ping):

# hcidump -xt
HCIDump - HCI packet analyzer ver 1.5
device: any snap_len: 65535 filter: 0xffffffff
1179336718.824335 < HCI Command: Create Connection(0x01|0x0005) plen 13
  36 E3 48 D1 12 00 18 4C 00 00 00 00 01=20
1179336718.827102 > HCI Event: Command Status(0x0f) plen 4
  00 01 05 04=20
1179336719.858619 > HCI Event: Connect Complete(0x03) plen 11
  00 0B 00 36 E3 48 D1 12 00 01 00=20
1179336719.858674 < HCI Command: Write Link Policy Settings(0x02|0x000d)
plen 4
  0B 00 0F 00=20
1179336719.861166 > HCI Event: Command Complete(0x0e) plen 6
  01 0D 08 00 0B 00=20
1179336719.881159 > HCI Event: Max Slots Change(0x1b) plen 3
  0B 00 05=20
1179336729.090790 > HCI Event: Disconn Complete(0x05) plen 4
  00 0B 00 13=20
#

> > PPP over telephone Bluetooth works more or less stable.
> >
> > Of course, I can just use l2ping or 'hccontrol Inquiry' to check device
> > presence, but how to read signal quality in that case ?
>=20
> bluetooth 2.0 defines 'inquiry with rssi' command. of course your
> nokia phone should be 'visible/discoverable'. someone was working on
> making bluetooth 2.0 commands available in hccontrol.

inquiry is relatively long command, no I'm trying to avoid deal with it
for just proximity monitor.

Probably some obex activity will make connection keep-alive ?

> of course you could always do something like
>=20
> 1) hccontrol read_connection_list --- and see if baseband connection is p=
resent
>=20
> 1.1) if present, remember handle
>=20
> 1.2) if not, hccontrol create_connection -- and remember handle
>=20
> 2) hccontrol read_rssi <handle>
>=20
> 3) sleep and repeat

Yes, it is possible.

> 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?1179336829.1498.9.camel>