Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: MrPaulCarpenter on October 31, 2018, 08:53:06 PM

Title: wclClientConnectionConnectEvent event is not getting called from wclThread
Post by: MrPaulCarpenter on October 31, 2018, 08:53:06 PM
I have moved all of my logic to interact with WCL library into a singleton object that inherits from wclThread.  I did that to insure that all bluetooth calls are on the same thread.  Data is passed in using an observable collection.

However, my wclClientConnectionConnectEvent event is not getting called.  Using debugger I have confirm that:
1)   new wclRfCommClient() is successful,
2)   OnConnect is assigned,
3)   When btClient.Connect(radio) gets called, OnConnect is still assigned
4)   Events OnDiscoveringStarted, OnDeviceFound, OnDiscoveringCompleted, OnStatusChanged all are getting called
5)   In applications where I am not using wclThread, this works


Title: Re: wclClientConnectionConnectEvent event is not getting called from wclThread
Post by: Mike Petrichenko on October 31, 2018, 09:33:13 PM
Can you please send me your project so I can test it and fix (if needed) on my side.

Thank you.
Title: Re: wclClientConnectionConnectEvent event is not getting called from wclThread
Post by: Mike Petrichenko on November 01, 2018, 09:39:57 AM
Ok, here is very simple demo that shows how to use wclRfCommClient in thread (wclThread).

It discovers for devices, looks for first with SPP service (enumerate services of all found devices) and connects to it. Then is simple waits for any key to disconnect. While waiting it receives data from device.

P.S. Add correct reference to Bluetooth Framework DLLs before build the project.