Can Bluetooth Serial Port Service be turned on for communicating between two PCs?

Bob Gampert 0 Reputation points
2023-08-29T17:36:30.51+00:00

I'm trying to test communications between a primary desktop application and a secondary program designed to emulate a piece of hardware. Both programs are C# .NET apps using System.IO.Ports.SerialPort.

In the past, I've been able to communicate between the two programs running on a single PC by using a third-party virtual null modem program. I've also run them on separate machines connected by a USB null modem cable.

However, I'd like to be able to emulate the hardware connection on separate PCs via Bluetooth instead of USB.

I've been able to establish a pairing between the two PCs and add Incoming COM ports from the More Bluetooth Options page. When I try to establish an Outgoing COM port on one machine, the other shows up in the "Select Bluetooth Device" dialog. But when I select it I get a MessageBox that indicates "No serial ports detected: The device you selected does not have a serial port service running".

Is the serial port service available on a PC, and if so, how does one enable it?

Thank you,

Bob Gampert

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,347 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,208 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Muhammad Binyameen 390 Reputation points
    2023-09-05T17:23:54.47+00:00

    In order to enable the serial port service on a PC to establish communication via Bluetooth, you need to ensure that the necessary software components are installed and properly configured. Here are the steps to enable the serial port service:

    1. Verify Bluetooth support: Firstly, make sure that both PCs have Bluetooth capabilities and are correctly paired. This involves confirming that Bluetooth is enabled in the Windows settings and that the Bluetooth drivers are installed and up to date.
    2. Install virtual COM port software: To create a virtual serial port to emulate the hardware connection, you will need to install virtual COM port software on both PCs. There are various options available, such as the "Eltima Virtual Serial Port Driver" or "com0com". Install the software on both PCs.
    3. Set up virtual COM ports: Once the virtual COM port software is installed, open the software on both PCs. In the software, you should be able to create pairs of virtual COM ports. For example, you can create a virtual COM port pair with one end on PC A and the other end on PC B.
    4. Configure the virtual COM ports: After creating the virtual COM port pair, configure the settings of the virtual ports. Make sure the baud rate, parity, stop bits, and other settings match the requirements of your communication protocol.
    5. Configure the serial port settings in your C# applications: In your primary desktop application and the secondary program, ensure that the SerialPort settings are correctly configured to use the virtual COM ports. Set the port name to the appropriate virtual COM port that corresponds to the other PC.
    6. Test the communication: Finally, run your applications on the respective PCs and attempt to establish communication using the virtual COM ports over Bluetooth. Monitor the serial port events and handle any errors or exceptions that may occur during the communication process.

    By following these steps, you should be able to establish communication between your primary desktop application and the secondary program emulating the hardware connection on separate PCs via Bluetooth.