.NET Components for Mobility

Beginers Bluetooth -- Visual Basic 2005

Last post 03-09-2008 11:29 AM by alanjmcf. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-08-2008 2:47 AM

    Beginers Bluetooth -- Visual Basic 2005

    If anyone can help me id extremely happy. im currently serving in the Peace Corps in africa and i need to create a program that would run on a pc (which would be hooked up to a bluetooth dongle).  I want to program to connect to a bluetooth cellphone (via the dongle) and send out messages to multiple recipients (the program would send the message and cellnumbers to the cellphone).  i have no experience with bluetooth but i have a decent amount of experience with vb.net. i dont want to have to download and use third party sdk's (i dont even know if i need to but if i do, i can afford them as im doing volunteer work).  can i just use the microsoft.windowsmobile.sharedsource.bluetooth.dll file to do this.  if so, where can i get documentation on using.  if anyone can help be (or at least point me in the right direction) learn the steps i need to take to accomplish this program id be really happy.  im developing in visual basic 2005 express edition. 

    Filed under: ,
  • 03-09-2008 11:29 AM In reply to

    Re: Beginers Bluetooth -- Visual Basic 2005

    I'd recommend using our library, the one you mention isn't not actively supported as far as I know.  As to download size I can send you the library DLL alone if that would help.

    I _assume_ that you can use AT commands to send the text messages, and thus can connect to the SerialPort (or maybe DialupNetworking) service on the phone to do so.  If so, to make the Bluetooth connection see the code below which is from the user's guide doc.

    Dim addr As BluetoothAddress _
      = BluetoothAddress.Parse("001122334455") 'replace with read it from storage etc
    '
    Dim ep As New BluetoothEndPoint(addr, BluetoothService.SerialPort)
    Dim cli As New BluetoothClient
    cli.Connect(ep)
    Dim peerStream As Stream = cli.GetStream()
    peerStream.Write/Read ...

    You can discover the phone once maybe with the code below and store its address in a file (etc) and reuse it each time rather than doing a discovery each time.

    Dim dlg As New SelectBluetoothDeviceDialog
    Dim result As DialogResult = dlg.ShowDialog(Me)
    If result <> DialogResult.OK Then
      Return
    End If
    Dim device As BluetoothDeviceInfo = dlg.SelectedDevice
    Dim addr As BluetoothAddress = device.DeviceAddress
    ...

    Let me know if that sounds good.  You can send me a 'private message' with your email address if getting the ~200KB library would be an easier download than the ~3MB release. :-)

    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.