Bluetooth Proximity Monitor on FreeBSD ?

Vladimir Grebenschikov vova at sw.ru
Wed May 16 17:33:55 UTC 2007


В ср, 16/05/2007 в 09:45 -0700, Maksim Yevmenkin пишет:

> > 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 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=0 time=65.077 ms result=0 
0 bytes from e60 seq_no=1 time=52.096 ms result=0 
0 bytes from e60 seq_no=2 time=54.053 ms result=0 
0 bytes from e60 seq_no=3 time=42.082 ms result=0 
0 bytes from e60 seq_no=4 time=42.151 ms result=0 
0 bytes from e60 seq_no=5 time=5129.224 ms result=0x4  <<< connection
lost here 
...


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 
1179336718.827102 > HCI Event: Command Status(0x0f) plen 4
  00 01 05 04 
1179336719.858619 > HCI Event: Connect Complete(0x03) plen 11
  00 0B 00 36 E3 48 D1 12 00 01 00 
1179336719.858674 < HCI Command: Write Link Policy Settings(0x02|0x000d)
plen 4
  0B 00 0F 00 
1179336719.861166 > HCI Event: Command Complete(0x0e) plen 6
  01 0D 08 00 0B 00 
1179336719.881159 > HCI Event: Max Slots Change(0x1b) plen 3
  0B 00 05 
1179336729.090790 > HCI Event: Disconn Complete(0x05) plen 4
  00 0B 00 13 
#

> > 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 ?
> 
> 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
> 
> 1) hccontrol read_connection_list --- and see if baseband connection is present
> 
> 1.1) if present, remember handle
> 
> 1.2) if not, hccontrol create_connection -- and remember handle
> 
> 2) hccontrol read_rssi <handle>
> 
> 3) sleep and repeat

Yes, it is possible.

> thanks,
> max
> 
-- 
Vladimir B. Grebenschikov
SWsoft Inc. vova at swsoft.com


More information about the freebsd-bluetooth mailing list