I have a HC-05 bluetooth module that is connected to my Arduino which is sending data to the COM port on my laptop via bluetooth.
I am looking to create a script using C to build into an executable file.
With the script, I am trying to first check which COM ports are "Standard Serial over Bluetooth Link" and then see which one of those are the "Outgoing" COM port. Then, I am aiming to open this port and read the data from it.
Can anyone please provide some guidance as to how to go about this? Is this possible using C code? I have seen some C# code posted online linked to this.
Regarding the OS, I am looking to use this in Windows.
I have had some success using WINDOWS API to open and read ports. But the issue I'm facing is that I don't know a way to determine which of the COM ports are Standard Serial over Bluetooth Link and Outgoing.
I have found it easier to use sockets rather than COM ports. This way, it is not necessary to pair the device - in fact it must not be paired, so unpair it first. This works for me: