Device references mDevice. So in matter of functionality it doesn't matter which one I use. (But of course it matters in regards of clean code and I will change it...)
Also from the details of the exception (attached to my first post) one can see that the exception is thrown inside WCL:
Module = wcl.dll. If Device would really be null as you assumed then the exceptions module would be my own
Module = Bluetooth.dll. So I still suspect there to be a bug in the new WCL version.
My suspision is that wclBluetoothRadio objects are now disposed to early in some cases. To verify this I made a small test application which is attached to this post. What I found:
- The OnDiscoveryComplete event gives a reference to the discovered device and the radio it was discovered on.
- When the reference to that radio is later used again I get an object disposed error
To see what I mean please start the test application, click "Discover Devices", wait until some devices are displayed, then click "Check Paring Status". This will lead to an exception.
So to me that seems as if WCL would dispose a radio despite it still being referenced by my test code. This is not the behaviour I would expect. Could you please confirm if this is a bug or am I misunderstanding something here?
[attachment deleted by admin]