UPD: Seems, this relationship can be done only for "Outgoing" serial ports..
UPD: Seems, this relationship can be done only for "Outgoing" serial ports..
Hi,
Do you have any hints as to how to discover this relationship?
Thanks
Ohhh.. it is not simple:
1) We need enumerate all BT devices, using SetupApi.
2) We need store each "FriendlyName" of BT device, and need to parse its BT address and store it too..
3) We need enumerate all serial ports, using SetupApi
4) We need parse each "Device Instance Identifier" of each serial port for matching to the same BT address.. Things is that the outgoing BT serial ports contains a BT address inside of own "Device Instance Identifier" string. So, we need to parse this BT address from the string and to compare with each of the BT address of previously saved BT device... When the addresses were equal, then we take the "FriendlyName" from the stored BT device. This "FriendlyName" will be a name of assigned BT device to the serial port. But! This does not work with the "Incoming" serial ports, because its "Device Instance Identifier" string does not contain a BT address!
PS: Maybe, can be used the winAPI for bluetooth devices, instead of the Registry parsing... But, I am not sure that is is a good idea, because this API is blocking and for other reasons...
PS2: Also, maybe, you can use the WMI, but this question is out of scope.
Thanks for taking the time to look at this. I think I am going to park the issue.
Thanks.
Bookmarks