Hello,
BSBT manager is notified too. But. What I did to reproduce the issue and what I have found:
1. I used Samsung cell phone which has SPP profile.
2. I paired it with PC (PC runs BS 8.0.376.0 on Win 7).
3. I searched its services with BS BT manager.
4. I connected to SPP profile on cell and BS created a COM port for this connection. Let say it is COM11.
Now when I do not use WCL (or use WCL without loading BS API/SDK).
4.1. If I open COM11 from any application/code all works great.
4.2. I close COM11 - device disconnects.
4.3. I open COM11 again - PC (BS) connects to device and all works great again.
4.4. .... I can repeat steps 4.1-4.2 any times. All works.
Now I modified my test code to call wclAPI.Load (to load BS API/SDK). And I got:
5.1. If I use same COM11 created on step 4 and simple open port with CreateFile an app freez for a few seconds (very long time, may be seconds 20-30) on CreateFile function. Even BS and cell shows that connection already exists. After that time (20-30 seconds) my application is notified from BS than outgoing connection has been established and CreateFile returns and all works.
5.2. After that I close the COM11 and again I got freez on CloseHandle function for about 20-30 seconds. After that time the app is notified about outgoing connection is closed and connection is actualy closed.
5.3. If I try to open COM11 again (with scenariuos described in step 5.1) it may work or may not work. Usualy it doesn't work even CreateFile returns valid handle (fast, without any delay) but no connection, not data transferring. Even if I close app and open it again. Only dongle replug helps. Sometimes it may work two times and then stop working again.
And the final test I did:
6.1. I used wclVirtualPortCreator to create vCOM for BS (wclAPI loads BS API/SDK). In this case I got other COM number (let say COM12). So I call wclVirtualPortCreator.Open function, get new created COM number (COM12) and use it in CreateFile function. Now it works fast (without any delay).
6.2. I close COM12 (CloseHandle) and destroy vCOM (wclVirtualPortCreator.Close). Device is disconnected, port destroyed.
6.3. I back to step 6.1. - All works again.
In this case (steps 6.1.-6.3.) all works greate any times you want repeat that.
I don't know why, but it looks that if you try to use COM port created in BS BT manager and then try to use it in any application uses BS SDK then you get a problem. If your application doesn't use BS SDK then the port works great. But if you create a COM port in your application uses BS SDK then the port works greate.
I do not think it is something with hooking BS callbacks because BS BT manager is always notified about actions with BT in any case. But in case when you use COM port created in BT manager and use it in app with BS SDK it dies.
So that's what I got. Just FYI.