0

This is for all who know the ins and outs of bluetooth programming using 32feet.net / InTheHand

I'm coding under Windows 8 on a PC in vb.net 2008 using 32feet.net 3.5.0.3's InTheHand.Net.Personal.dll

My goal: Connect my PC via Bluetooth to my Samsung Galaxy S6 Android 6.0.1 (Marshmallow) and copy a file to the phone.

This is what I'm coding:

(...)
Imports InTheHand.Net
Private Sub demo()
  Dim peer As Sockets.BluetoothDeviceInfo
  Dim req As ObexWebRequest
  For Each peer In New Sockets.BluetoothClient().DiscoverDevices()
        If peer.DeviceName = "MyGalaxyPhone" Then
            req = New ObexWebRequest _
                 (peer.DeviceAddress, _
                  "obex://c:/users/admin/documents")
            req.ReadFile("c:\users\admin\documents\test.txt")
            req.GetResponse()
            Exit For
        End If
  Next
End Sub
(...)

At req.GetResponse I get an exception saying System.Net.WebException {Connect failed}

When I tried getting the supported Services using peer.InstalledServices I get 1105 among others, but not 1106 which seems to be necessary for OBEX. 1105 is for OPP as I understand from the doc. However I don't know how to call any OPP function.

Any help appreciated.

Thanks

S. Roy

1 Answers1

0

I apparently didn't know what I was doing. In my code above I wrote:

req = New ObexWebRequest _
             (peer.DeviceAddress, _
              "obex://c:/users/admin/documents")

This can't work. It should say:

req = New ObexWebRequest _
             (peer.DeviceAddress, _
              "obex://" + peer.DeviceAddress.ToString + "/test.txt")

This works.

Regards