Search code examples
c#wpfbluetoothrfcommspp

Bluetooth communication using serialports and windows 10 (spp1.1)


I have a problem with bluetooth connection between windows 10 and external device wherein manufacturer (lets say that CompanyX) use Serial Port Profile 1.1. Only what i get from CompanyX is documentation about communication using virtual serial ports. It is not good solution because Windows 10 have only SPP 1.2 so i have a lot of problems with pairing and connecting this device.

In my WPF c# application I use Gurux lib. When device connected I don’t have any problem to send and receive data but in 99% connection attempts port is busy so connecting takes too long (sometimes 10/15 minutes). Whats more… Windows 10 have a problem with pairing and it happens that device is connected but don’t have any port names. I tested this case for a several devices with Windows 10 and one tablet also have problem with remove paired device even if I did it in regedit.

Few days ago CompanyX told me that we can connect their device to Windows 10 using rfcomm and it (propably) works but they don't want to say how to do that . I have MAC address this device but I don’t know rfcomm technology (only know that is client/server communication).
 Can anyone help me what in this case? Some examples or tips? I am new in c# so I need your help to solve this problem.



Solution

  • My best guess is that RFCOMM refers to Serial Port Profile SPP, which basically emulates serial port through the Bluetooth. That is not going to directly solve your problem. indeed, Windows 10 does have a lot of problems with pairing other Bluetooth devices. However, you may try the following workaround, which basically boils down to orderly reboot of serial ports and Bluetooth. Here it goes: unpair all Bluetooth connections on your machine, shut down the Bluetooth completely, and close down any serial port that you suspect that was open or associated with connection.

    I am not familiar with Gurux except that it seems that they are oriented towards the smart meter readers. Perhaps you can find better solution on the GitHub, for example : inthehand/32feet; https://github.com/inthehand/32feet/tree/master/InTheHand.Devices.Bluetooth/InTheHand.Devices.Bluetooth.Win32

    regards, Vlad p.s. I would vote you up, but have not sufficient reputation for it. Your question is good.