software you can take with you

no luck with discovery...

Last post 01-08-2012 2:14 PM by alanjmcf. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-04-2012 9:58 AM

    • edsut
    • Not Ranked
    • Joined on 01-04-2012
    • Posts 2

    no luck with discovery...

    Hi, I'm new to BlueTooth, and while I've searched the forum and haven't found an answer I start by apologizing if the answer is obvious.  That being said, here's my problem:  I'm trying to access bluetooth through C# (.NET 3.5), and as of now have not been able to even get discovery to work.  I'm using 32feet.NET.2.3.  I've tried both SelectBlueToothDeviceDialog() and BluetoothClient.DiscoverDevices.  Both attempts come back empty.  I then found code that suggested first checking BluetoothRadio.IsSupported, and sure enough, that comes back false.  I am able to just right click on my bluetooth icon and have it successfully discover a few different devices, so I know my PC (IBM ThinkPad) is enabled for it.  The driver is from Broadcom dated 4/20/2006, and I did run "Update Driver" prior to this.

    Here are the two different code snippets (both of which I shamelessly grabbed from this forum and other google results)...

    using InTheHand.Net.Sockets;

    using InTheHand.Net.Bluetooth;

    using InTheHand.Net;

    using InTheHand.Windows.Forms;

    private void bluetoothDiscover1()

    {

    try

    {

    if (!BluetoothRadio.IsSupported)

    {

    Trace("BluetoothRadio not supported");

    return;

    }

    }

    catch

    {

    Trace("BluetoothRadio not supported!");return;

    }

    if (BluetoothRadio.PrimaryRadio.Mode == RadioMode.PowerOff)
    BluetoothRadio.PrimaryRadio.Mode = RadioMode.Connectable ;

    Trace("BlueTooth radio name: " + BluetoothRadio.PrimaryRadio.Name.ToString());

    Trace("BlueTooth radio mode: " + BluetoothRadio.PrimaryRadio.Mode.ToString());

    BluetoothClient bc = new BluetoothClient();

    BluetoothDeviceInfo[ devices = bc.DiscoverDevices();

    Trace(tracelevel.NORMAL,"BTdevtot: " + devices.Length);

    for (int i = 0; i < devices.Length; i++)

    {

    Trace(devicesIdea.DeviceName + ":" + devicesIdea.DeviceAddress);

    }

    }

    Snippet #2:
    private void bluetoothDiscover2()

    {

    SelectBluetoothDeviceDialog sbdd = new SelectBluetoothDeviceDialog();

    sbdd.ShowUnknown = true;

    sbdd.ShowRemembered = true;

    sbdd.ShowAuthenticated = true;if (sbdd.ShowDialog() == DialogResult.OK)

    {

    }

    }

     

    For bluetoothDiscover1, BluetoothRadio.IsSupported is false.

    For bluetoothDiscover2, the dialog box comes up, but there's never a discovery.

    Any thoughts?

    Thanks in advance.

  • 01-04-2012 12:15 PM In reply to

    Re: no luck with discovery...

    There are multiple suppliers of Bluetooth stack for Windows.  We support all of the main ones except for Toshiba who aren't keen to provide their SDK.  Its possible your PC has that stack installed.  Can you check.  See e.g. http://32feet.codeplex.com/wikipage?title=Supported%20Hardware%20and%20Software and thus http://32feetnetdev.wordpress.com/2011/02/03/how-stacks-show-radio-version/ and http://www.bluecove.org/bluecove-examples/bluetooth-stack.html  In short look in Device Manager (or Control Panel) to try and find which stack your PC has.

    If its Toshiba for instance you might want to disable it and use the Microsoft stack instead.  You then can program against it (but might lose some profiles).

  • 01-05-2012 9:15 AM In reply to

    • edsut
    • Not Ranked
    • Joined on 01-04-2012
    • Posts 2

    Re: no luck with discovery...

    Thanks for the response Alan.  I had looked at that based on other forum reading and it appears (assuming I'm reading everything correctly) to be from Broadcom. The driver details indicate that the device type is Broadcom Devices and the manufacturer is also Broadcom.  Does this imply a broadcom stack?

  • 01-08-2012 2:14 PM In reply to

    Re: no luck with discovery...

    I've just re-read your first post and noticed that you're using v2.3. Why??? :-,(  Back then we *only* supported the MSFT stack.  If you use a current version then you should be more successful.  For Widcomm one needs to also copy the 32feetWidcomm.dll file along the app and the 32feet.NET library assembly.

    (In Device Manager the parent device is called "Bluetooth Devices" for Widcomm, and "Bluetooth Radios" for MSFT).


Page 1 of 1 (4 items)
Copyright © 2001-2013 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting