0
Answer

C# : Threading with bluetooth connection

Ask a question
Hi all, I am using 32 feet.NET (http://32feet.net/files/18/releases/default.aspx) bluetooth library for using BT in my C# application I do with Visual Studio .NET 2005. I am going nuts about how to make properly usage of threading mechanisms like Timer, backgroundworker, or instances from the Thread class itself. My app starts with Form1.cs on which I have a connect button that tries to connect to a device I have previously found (and selected). When I click on "Connect" I instantiate the class "Sentinel" which I pass an EndPointDevice as argument. In its constructor, it will try to connect and then start a thread which will "guard" the device, i.e. it will try to disconnect and reconnect until the user decides to stop the guarding process. This guard method of Sentinel will create a form on top of all other windowses when the device is not reachable. This form has a password txt field. My problem is that when this form pops up, I see the hourglass and the field, but I cannot click into it or type anything : the application is locked probably with the underlying "guarding" process. The form should further close when the device is in range again. Actually my problem is the one that I can't access the field. Now I tried several thread managing implementations of C#: timers, backgroundworkers and Thread, but it doesn't alleviate the problem. Any ideas? Should I post the code here?