.NET Components for Mobility

Device Discovery value is not populating

Last post 09-21-2010 5:13 PM by alanjmcf. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 09-02-2010 10:11 AM

    • heema1
    • Top 150 Contributor
    • Joined on 08-19-2010
    • Posts 9

    Device Discovery value is not populating

    Hi All,

     I am trying to send the file via bluetoth from one PC to another PC.I have written the sending side and reciving side code.And it works properly in windows vista.

    But when i try sending a file from windows 7 PC.....it does not detect the bluetooth devices.

    Piece of code is:

    BluetoothRadio.PrimaryRadio.Mode = RadioMode.Discoverable; ol = new ObexListener(ObexTransport.Bluetooth);

    BluetoothClient client = new BluetoothClient();

    BluetoothDeviceInfo[ devices = client.DiscoverDevices();

     

    But devices array is not populating.I could not figure out why it is not populating as this works perfactly in my Vista laptop.

    Thanks

  • 09-05-2010 8:12 AM In reply to

    Re: Device Discovery value is not populating

    Is Bluetooth working at on the Windows 7 device?  What happens if you try to add the device via Devices and Printers UX[1].  Does discovery there find it?

     

     

    [1] Slide 13 at http://www.alanjmcf.me.uk/comms/bluetooth/Bluetooth%20in%20Windows%207.html

  • 09-08-2010 7:26 AM In reply to

    • heema1
    • Top 150 Contributor
    • Joined on 08-19-2010
    • Posts 9

    Re: Device Discovery value is not populating

    Hi,

    Thanks for the reply. I tried it with Devices and PrinterUX ..and yes it discovers  devices there.I want to tell you that the bluetooth dongle that i m using is Belkin F8T017 and it is broadcom bluetooth stack.I came to know that32feet.net works only for microsoft bluetooth stack.Is my problem because of broadcom stack??? i tried to install the microsoft stack instead of broadcom stack by editing in C:\WINDOWS\inf\bth.inf by referencing http://www.shootingsoftware.com/Widcomm.htm. But program is still not discoving any bluetooth device.

    Hope for any solution.

    Thanks

  • 09-17-2010 7:24 AM In reply to

    • heema1
    • Top 150 Contributor
    • Joined on 08-19-2010
    • Posts 9

    Re: Device Discovery value is not populating

    hi ,

    actually i uninstalled the broadcom driver of bluetooth and installed the microsoft one in one XP computer.and yes its working here.But the thing is that whenever i try to send a file from my mobile to laptiop ..my recevier side program is able to recive the file..but when i tried to send the file from a computer the reciver side program just became hang.My reciver side code is

    BluetoothRadio.PrimaryRadio.Mode = RadioMode.Discoverable; ol = new ObexListener(ObexTransport.Bluetooth);

    ol.Start();

    while (ol.IsListening)

    {

    MessageBox.Show("Listening");

    try

    {

    ObexListenerContext obexListenerContext = ol.GetContext();

    ObexListenerRequest obexListenerRequest = obexListenerContext.Request;

    btEndPoint = (BluetoothEndPoint)obexListenerRequest.RemoteEndPoint;

    InTheHand.Net.BluetoothAddress theSenderAddress = btEndPoint.Address;

    string filename = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "\\" + obexListenerRequest.RawUrl.Substring(1, 16);

    MessageBox.Show(filename);

    obexListenerRequest.WriteFile(filename);

    ol.Stop();

    sendAck(filename, theSenderAddress);

    MessageBox.Show(filename + "is received!"); break;

    }

    catch (Exception ex)

     

    {

    MessageBox.Show("Fail to get the File");break;

    }

    but when i tried to send the file from a PC ......program could not go further

    ObexListenerContext obexListenerContext = ol.GetContext(); line.

    I could not figure out what is the problem.Hoping for some solution for this problem

    Thanks

  • 09-20-2010 5:17 AM In reply to

    Re: Device Discovery value is not populating

    So that means that no incoming connection has arrived.  This happens when the ObexListener is running on your mobile?  If so, that's because the built-in OBEX server is getting the connection -- see the user guide for more.
  • 09-20-2010 6:52 AM In reply to

    • heema1
    • Top 150 Contributor
    • Joined on 08-19-2010
    • Posts 9

    Re: Device Discovery value is not populating

    Hi,

    thanks for the reply but this is happening when ObjestListner is running in the PC not in mobile.Any suggession for this?

    thanks

     

  • 09-21-2010 6:35 AM In reply to

    • heema1
    • Top 150 Contributor
    • Joined on 08-19-2010
    • Posts 9

    Re: Device Discovery value is not populating

    Hi,

    I realized that in the sender side program i was using

     headset = new BluetoothEndPoint(headsetAddress, BluetoothService.Headset);

    and this was throwing exception.

    "The requested address in not valid in its context InTheHand.Net.BluetoothEndPoint"

    then i changed that line to

    headset = new BluetoothEndPoint(headsetAddress, BluetoothService.RFCommProtocol);

    Now it does not throw the exception but now reciver side is not able to recive any file.

    I am really in trouble with this problem.Any suggesion please

    Thanks

  • 09-21-2010 5:13 PM In reply to

    Re: Device Discovery value is not populating

    I don't understand.  Your previous post was about using ObexListener.  I don't see how those commands (presumably passed to BluetoothClient.Connect) relate to OBEX at all.  Have a read of the User Guide (in the release or online at http://www.alanjmcf.me.uk/comms/bluetooth/32feet.NET -- User Guide.html) and see whether you want to use OBEX or a direct Stream/BluetoothClient/-Listener connection.
Page 1 of 1 (8 items)
Copyright © 2001-2012 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting