Search bluetooth devices and pair them programmatically

Hi All,

I am developing VB.Net smart client application for Pocket PC 2003. Here its required to connect my Pocket PC with GPS Device (TomTom Navigator) on BlueTooth Port.

Everything is working nice enough except I have to create pair between my Pocket PC and GPS Device manually.

What i want is my program should automatically search GPS device, It must create pair between them. Other than this, My application is already working fine.

Any class library or sample code. doesn't matter if its in C# or any other language of .Net.

Thanks in advance.


Answer this question

Search bluetooth devices and pair them programmatically

  • AdrianMills1973

    have you tried the bluetooth library from 32feet.net and the OpenNetCf community.(http://32feet.net/default.aspx)
    i have used it when connecting to a specific bluetooth address without haveing to pair them.

    maybe this is off the point


  • daviddavid

    I have tried it but i don't get satisfation in it. if you have any sample code, plz send me.

  • idflyfish

    I'd be very interested if this is possible.  We've tried to make our software as robust as possible by re-installing it after a cold-reset, but when confronted with blue-tooth GPS devices we told our customers to pair them manually, as we couldn't find out how to do it programatically

    Good luck!

  • Jensk

    Thanks for your question.  This scenario is currently not supported on Windows Mobile.  I have put it on our radar for future releases.

    -Anil.

  • zhyluo



    Dim l_BTClient As New BluetoothClient
    l_BTClient.Connect(New m_BTClient.Connect(New BluetoothEndPoint(BluetoothAddress.Parse("00:03:7A:25:2D:F9"), BluetoothService.SerialPort))

     


    so what i was doing was bluetooth printing so i would just send a stream out on the l_BTClient.GetStream()


  • PGordini

    Hi Barry

    Thanks for your help.

    Actually OpenNetCF didn't work for me. I have used its lates version InTheHand.Net.Bluetooth library.

    Here is the code I have used in my app.

     


    Public Function ConnectBlueTooth() As Boolean

            Dim BTMac As String = "00:01:58:08:3D:ED"
            Dim BTAddress As BluetoothAddress
            Dim BTClient As New BluetoothClient
            Dim BTEndPoint As BluetoothEndPoint
            Dim BTRadio As BluetoothRadio

            BTRadio.PrimaryRadio.Mode = RadioMode.Connectable

            Dim spguid As Guid = BluetoothService.SerialPort
            BTAddress = BluetoothAddress.Parse(BTMac)
            BTEndPoint = New BluetoothEndPoint(BTAddress, spguid)
            Try
                BluetoothSecurity.PairRequest(BTAddress, strDevicePassKey)
                Application.DoEvents()
                BTClient = New BluetoothClient
                BTClient.Connect(BTEndPoint)
                Return True
            Catch e As Exception
                Return False
            End Try
        End Function


     



    Thanks,



  • Search bluetooth devices and pair them programmatically