Recent Posts

Pages: [1] 2 3 ... 10
1
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.
2
Can you please send me your project so I can test it and fix (if needed) on my side.

Thank you.
3
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


4
Bluetooth Framework / Re: .Net Device Discover
« Last post by Mike Petrichenko on October 31, 2018, 06:06:17 PM »
EnumRemoteServices executes connection to device and always takes time. Also that is no good idea (by few reasons) to query device until OnDisconveryCompleted fired. It may cause problems becuase disocvering command is exclusive. Its better to store device's MAC in the list inside OnDeviceFound and then do all the things you need inside OnDiscoveryCompleted.

It is not a problem to run EnumRemoteServices for each found devices in separate threads so ti will not blovk UI.
5
Bluetooth Framework / Re: .Net Device Discover
« Last post by sommerat on October 31, 2018, 05:51:17 PM »
Thanks for the reply; I just found out that it really does happen in OnDeviceFound - I call GetRemotePaired and EnumRemoteServices and the such inside it. If I remove that from code there is no freeze of UI.
But before 7.5.x this sequence of function calls worked like a charm...
I guess i can restructure the program to call those Radio functions after the discovery has finished unless you would say this should still work; then I could send you some code snippets.

I will get back to you next week!
6
Bluetooth Framework / Re: .Net Device Discover
« Last post by Mike Petrichenko on October 31, 2018, 05:27:46 PM »
Can you please send me the code that reproduces the issue by skype (mike.petrichenko) or by-email (mike@btframework.com) so I can reproduce it here and fix if it is something in Bluetooth Framework?

In fact there is nothing that may cause freez of main UI thread because discovering runs in separate thread always and simple posts (not send!) notification to the main thread.

Also, do you run it (discovering) in thread? If so, how do you do it?

You can contact me by Skype to solve the problem faster.
7
Bluetooth Framework / Re: .Net Device Discover
« Last post by sommerat on October 31, 2018, 05:23:55 PM »
The freeze actually occurs before OnDeviceFound and freezes longer if there are more devices around.
The Callbacks do pretty much the same as in the Bluetooth Manager example - add devices to a List and set result for a task on completion; but they are called after the freeze, so it cannot be something inside those.
10
Bluetooth Framework / Re: .Net Device Discover
« Last post by Mike Petrichenko on October 31, 2018, 02:49:28 PM »
Hello,

Unfortunately its hard to say what can be wrong without seeing your code. Probably you do something inside OnDiscoverCompleted event.
Pages: [1] 2 3 ... 10