1

I am using Delphi 10.3 on Windows 10.

I need to find the COM ports that a paired Bluetooth device is using, and then connect to the device.

I have looked on Bluetooth manager and found nothing relating to COM port.

Hak
  • 69
  • 8
  • 2
    Generally if it provides a COM port interface that is so it can be used as a COM port by other applications on the system instead of them having to work with Bluetooth directly. – Brian Apr 15 '20 at 19:33
  • I ended up looking in the windows registry and matched the Bluetooth device to a com port. – Hak Apr 17 '20 at 08:19

2 Answers2

0

This code will list all the devices on your computer. You can then extract the com ports and printer ports by looking for the 'COM' and 'LPT' characters in the list.

Add a memo and a button and place this code in the OnClick of the button.

 Procedure Tform1.Button1Click(sender:Tobject);
 var 
   iStr:string;
   iSize,i:Dword;
 begin
   setlength(sStr,4000);
   iSize:= QueryDosDevice(nil,@iStr[i],4000);
   for i:= to iSize do
     if iStr[i]=#0 then iStr[i]:=#10;
   memo1.lines.commatext:=iStr;
 end;` 

This code is not mine credit to the person who wrote it. If this isnt the code you're looking for I'll take it down.

Umsugi
  • 53
  • 1
  • 7
0

You can use the AsyncPro. Its compatible until the 10.3 Rio. Async Pro Github

Aras
  • 1
  • 3