How can I find out a COM port number of a bluetooth device in c#?

后端 未结 6 989
逝去的感伤
逝去的感伤 2020-12-10 02:44

My company developed a device that communicates with a PC via Bluetooth using a virtual COM port.

Now we need a user to pair a device with a PC (MS Windows OS) firs

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 03:01

    So, to get the information about a remote device including its name, using 32feet.NET do:

    BluetoothAddress addr = ... ...
    BluetoothDeviceInfo info = new BluetoothDeviceInfo(addr);
    string name = info.DeviceName;
    

    If not using the library you'll have to P/Invoke Win32's BluetoothGetDeviceInfo.

提交回复
热议问题