.NET Components for Mobility

Discover present devices within range

Last post 08-14-2007 5:53 AM by alanjmcf. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-12-2007 12:08 PM

    Discover present devices within range

    Hi there

    I have a rather annoying problem I hope someone can help me solve.

    I'm writing a custom implementation using a subset of the 32feet.NET library. My project uses the simple Bluetooth device discovery already present in the library, but I have a problem determining whether the discovered devices actually are in range or just remembered.

    My scenario is this: A thread is running continuosly, searching for nearby devices. I'm returning every device, as I need the addresses for a lookup mechanism defined elsewhere. The search is working well, and the devices are returned as expected. However, if a device is previously paired with my computer, they appear as remembered devices, even if they are turned of or out of range, which is a huge problem for my application.

    So everything boils down to the following question:
    How can I make a devicescan and return ONLY actual present devices?

    Since I haven't been able to find any solution yet, I have thought of making a separate thread checking device connectivity after each scan. This, however, seem like a bit of a hack, and I wonder if my problem have got no easy solution?

    Anyone, help... :)

    Filed under: , ,
  • 08-14-2007 5:53 AM In reply to

    Re: Discover present devices within range

    It something we haven't found a good solution for when we've discussed it before http://32feet.net/forums/t/1125.aspx.  The LastSeen property of BluetoothDeviceInfo is wrong; attempting a connection to each device works -- obviously -- but likely makes the peer device(s) beep etc, and may be slow; I suggested BluetoothDeviceInfo.GetServiceRecords which might not cause the device to beep.

    Other than that, I've never been 100% sure of how the three flags to DiscoveryDevices work, individually and together.  You might want to check how they work and how the native flags work.

    As I note at the bottom of the referenced thread, getting Microsoft to fix the stLastSeen value would solve the problem...

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
Page 1 of 1 (2 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.