0

What I want to achieve: Write a VB.NET program that grabs a folder structure on my Windows 8 and copies the structure to a base directory on my Samsung Galaxy S6 via Bluetooth.

I am using 32feet by alanjmcf - Thanks for providing this wonderful api.

What I have managed so far: I wrote a VB.NET 32feet application that successfully copies 1 file from Windows to my Samsung Galaxy S6.

The code extract:

    Public Sub demo()
       Dim peer As Sockets.BluetoothDeviceInfo
       Dim req As ObexWebRequest

       For Each peer In New Sockets.BluetoothClient().DiscoverDevices()
           If peer.DeviceName = "Galaxy S6" Then
               req = New ObexWebRequest _
                    (peer.DeviceAddress, _
                     "obex://" + peer.DeviceAddress.ToString + "/" + "test.txt")
               req.ReadFile("c:\users\admin\documents\test.txt")
               req.GetResponse()
               Exit For
           End If
       Next
    End Sub

My Samsung mobile asks a confirmation. Upon my "Go" it receives the file.

I would like to copy multiple files from a folder structure instead. And put them into an analogous folder structure in my Samsung mobile.

I could of course iterate through my files and repeat the block above, possibly specifying folders in the URI,

but my Samsung will ask my confirmation for each file, which is not manageable.

What can I do?

Thanks and regards S. Roy

  • You can `zip` the files, or make a `manifest file` (which contains what folder will the file will be extracted) + actual files compress it to zip then send it via `Bluetooth`. Make an `Android` app that listens for Bluetooth file transfer that also reads the manifest and extract the file to their designated folder. – conquistador Dec 12 '16 at 16:40
  • Thanks conquistador. I will try that. I thought I could circumvent the Android app. But if that's what it takes... – user3599802 Dec 12 '16 at 22:16
  • I think you should install a Bluetooth FTP server application and then use OBEX FTP protocol instead of OBEX OPP. – KYHSGeekCode Apr 16 '18 at 16:11

1 Answers1

0

Do you mean by "confirmation" is that your Samsung mobile requests pairing by showing a PIN number? If so, then you need to stop the pairing request to be sent to clients from the VB.NET server. I think you can do that by setting the AuthenticationLevel in your request.

For a BluetoothClient instance, I usually set the Authenticate property to false to stop request for pairing.

One more thing, when working with OBEX, I prefer to stop the OBEX Windows service from the services console, so it cannot interfere the Bluetooth communication.