I´m making a script to send and receive data to/from Bluetooth serial, but I´m having a problem to connect to the com port.
The problem is that I´ve two ports, one is the COM4 and the other is COM6 (not using at the same time)
COM4 is a standard com port thought USB port that I can connect using CommMG, it´s working fine.
_CommSetPort($port, $sportSetError, 9600, 8, 0 ,1,0) COM6 is a Bluetooth serial, that only works (I mean I can connect, send and receive data) with _WinAPI_CreateFile.
$openport = _WinAPI_CreateFile("COM6", 2, 6) . . . _WinAPI_ReadFile($openport, DllStructGetPtr($tBuffer), 1, $nRead) $sText = BinaryToString(DllStructGetData($tBuffer, 1))
If I try to connect the COM4 with _WinAPI_CreateFile it´s not working... and when I try to connect with CommMG to COM6 it´s give a -16 (Port not found) error..
The problem is:
How can I open/connect to the bluetooth (COM6) port using CommMG ( to write one single script instead of two - one using CommMG and another using _WinAPI_CreateFile)...
Thanks in advance!
Hello everyone. This is my second tool concerned with Bluetooth Technology. It uses native windows bluetooth functions to discover bluetooth devices near you.
Workable for all devices supporting Plug-And-Play in Windows. Download here (source code included).
All suggestions are welcome.