NULL ) // hTemplate must be NULL for comm devices For example: TCHAR *pcCommPort = TEXT("COM3") Ġ, // must be opened with exclusive-access The Read, write, or read/write access can be specified by setting dwDesiredAccess parameter. >However it turns out that COM3 is used for both input and output on my bluetooth modem. I wish Microsoft would make their bluetooth software like Toshiba bluetooth stack - with this software my bluetooth modem gets assigned one single COM port and the whole process of identifying the correct COM port for my bluetooth modem is a lot simpler! ![]() So what is the point in windows 10 assigning COM4 to my bluetooth modem when it cannot be opened as a file and appears to serve no purpose? However it turns out that COM3 is used for both input and output on my bluetooth modem. In the current example I end up with COM3 (input) and COM4 (output) listed under HKEY_LOCAL_MACHINE=>HARDWARE=>DEVICEMAP=>SERIALCOMM. This includes the possibility that the same COM port is used for both input and output. So inside this registry folder I am searching for all the available com ports and then trying all combinations of in and out ports (created via API ::CreateFile(.)) until I find the correct pair associated with my bluetooth modem. These then appear in the registry under HKEY_LOCAL_MACHINE=>HARDWARE=>DEVICEMAP=>SERIALCOMM ![]() ![]() When I pair Windows 10 with a HC05 bluetooth module I get two COM ports assigned to - one outgoing and one incoming.
0 Comments
Leave a Reply. |