0

I have a tablet that has built in Bluetooth. I have a device which is serial that I have connected to a bluetooth to serial converter using the DTE setting. This one to be exact: enter link description here

It creates/uses two serial ports. The one with the -dev is the one that is used since the tablet is the main one making the connection. In the device manager, both com ports show up as "Bluetooth com device" but you can't tell which one is the -dev device without looking at the properties and then choosing "Bus Reported Device Description". I need to find a way using vb.net to loop through the ports, check the "Bus Reported Device Description" and choose that com port and open it if it has the -dev in that description.

Is there a way to do this?

Secondly, once that connection is made, since it uses serial com ports, once I open the com port, it of course says "opened" but it will show that even if the Bluetooth device isn't really connected. Is there a way to see in the same set of properties above, the "is connected"? It appears to be able to tell if it is really connected or not, not just that the com port itself is open.

mScientist
  • 27
  • 7
  • Does this answer your question? [How to get Bus Reported Device Description using C#](https://stackoverflow.com/questions/26732291/how-to-get-bus-reported-device-description-using-c-sharp) – David Sdot Nov 25 '19 at 20:14
  • It looks like it would come close if I knew anything about C# language. I have found code like the upper portion of that question and just like the comments, the upper portion just returns the normal description. The bottom half looks promising as it shows the Console.WriteLine(Win32DeviceMgmt.GetAllCOMPorts()[0].bus_description); in the comments, but I have no idea how to implement the main code for that into VB.net. But even that answer was not selected as "the answer" so not sure if that worked for them. – mScientist Nov 25 '19 at 20:23

1 Answers1

1

If you can live with a Powershell script, here is the solution I put together for the device its "Bus Reported Device Description" I needed to get:

(Get-WMIObject Win32_PnPEntity | where {$_.name -match "ethernet"}).GetDeviceProperties("DEVPKEY_Device_BusReportedDeviceDesc").DeviceProperties.Data
Mehrdad Mirreza
  • 984
  • 12
  • 20