This project has moved. For the latest updates, please go here.

Virtual Com port Service

Topics: Bluetooth - Other
Feb 22, 2012 at 1:42 PM

I am trying to pro grammatically determine which com ports have been assigned to which Bluetooth devices.  Any ideas how to accomplish this?

Developer
Feb 23, 2012 at 6:15 PM

Does http://32feet.codeplex.com/wikipage?title=Getting%20Virtual%20COM%20Port%20Names&referringTitle=Documentation help?

Feb 23, 2012 at 9:08 PM

Yes that tells me which ports are virtual com ports of the bluetooth connection, but not which device.

for instance, when I discover the devices in my office, I have :

>Morbo

>racerx

>10000004

>jim's_phone

....

And a few other devices with gibberish names.

If I go to the services tab for the bluetooth device MORBO (which I already paired with and established a serial port connection it says

Serial port (SPP) 'AT serial" COM5.

 

Is there not a value stored for that device which tells it com5? 

Developer
Feb 23, 2012 at 11:47 PM

From that article: "the remote device address is included in the PnP Id. In the following PowerShell example see the remote address as “00803A686519”."  Don't you see that in the PnP Id?  What Bluetooth stack does your PC have?

Feb 24, 2012 at 1:00 PM
Yes, but unless i'm misunderstanding the way the command works, it doesn't actually tell me which devices in the room I'm connected to. It shows which com ports are actually attached to a bluetooth device, but not which one. Below I cut and paste the results of using that command. As you can see, I have the 00803a686519 equivelant of -00805F9B34FB, which I assume is the signature of my computer's bluetooth device. However, since I have 5 mobile devices paired with the computer, I can't tell based on this information alone, which unit is which. Which is what I'm seeking.

I highlighted the bluetooth device code in light green, and the rest of the string that is identical from port to port in yellow. There is a unique section on each string, if that section corresponds to any of the information in the stack about the mobile device, then I can use it. Is there a query that will let me search through the stack for that section of the string?




PS C:\> Get-WmiObject -query "select DeviceID,PNPDeviceID from Win32_SerialPort"


__GENUS : 2
__CLASS : Win32_SerialPort
__SUPERCLASS :
__DYNASTY :
__RELPATH : Win32_SerialPort.DeviceID="COM58"
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
DeviceID : COM58
PNPDeviceID : BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&0000\7&386385D4&0&000000000000_0000005E

__GENUS : 2
__CLASS : Win32_SerialPort
__SUPERCLASS :
__DYNASTY :
__RELPATH : Win32_SerialPort.DeviceID="COM5"
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
DeviceID : COM5
PNPDeviceID : BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\7&386385D4&0&008098F7B7E3_C00000002

__GENUS : 2
__CLASS : Win32_SerialPort
__SUPERCLASS :
__DYNASTY :
__RELPATH : Win32_SerialPort.DeviceID="COM16"
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
DeviceID : COM16
PNPDeviceID : BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\7&386385D4&0&00027624F3A8_C00000000

__GENUS : 2
__CLASS : Win32_SerialPort
__SUPERCLASS :
__DYNASTY :
__RELPATH : Win32_SerialPort.DeviceID="COM59"
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
DeviceID : COM59
PNPDeviceID : BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\7&386385D4&0&008098F7B776_C00000003

__GENUS : 2
__CLASS : Win32_SerialPort
__SUPERCLASS :
__DYNASTY :
__RELPATH : Win32_SerialPort.DeviceID="COM60"
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
DeviceID : COM60
PNPDeviceID : BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\7&386385D4&0&008098F915ED_C00000002

__GENUS : 2
__CLASS : Win32_SerialPort
__SUPERCLASS :
__DYNASTY :
__RELPATH : Win32_SerialPort.DeviceID="COM61"
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
DeviceID : COM61
PNPDeviceID : BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\7&386385D4&0&008098F915F6_C00000002

Joshua White

__________________________________
UofL Bioengineer
Mobile 502-767-1722
Work 502-561-9040 x7007
Neuronetrix, Inc.
1044 E Chestnut St.
Louisville, KY 40204