Frameworks > Bluetooth Framework

Catastrophic failure while Pairing

<< < (2/3) > >>

Mike Petrichenko:
Thank you for the very detailed report. With that information I have found the problem and now fixing it. I didn't "lock" the Radio object in memory before access it. So it passed to unmanaged code and then the NET decrease the usage count of object. So when I do actually call of Paired the object already destroyed.

servel333:
Thank you very much.  I've been hunting through my code over and over trying to find this issue (and I found some unrelated bugs in the process) but couldn't figure out where it was coming from.  I look forward to the next release.

servel333:
I seem to be getting this error again and have been seeing it for a while now, but I have not had time to report it to you.  Here is as much detail as I can figure out.

My coworker and I both agree this error has something to do with an object being disposed or odd memory usage, but cannot find it in our code.  I've examined the Radio object that is passed around and cannot find anything wrong with it at any point.  The WCL.Radio has no function to determine if it is disposed however, all the other properties in the class return valid values.

Here is a flow to get to this error:
 - Device is put into Discoverable mode
 - Application begins discovering over and over until the user enters a passkey and selects a device to pair with in the UI
 - Application calls Pair ( radio, passkey )
 - If Pair was successful, the application calls IsPaired ( radio )
 --  This is the call to WCL.Device.Paired that gives the "Catastrophic failure" error, oddly after another call to WCL.Device.Paired immediatly before.

Here is the flow of each of the specific wrapper functions involved:

Pair ( radio, passkey )
    If IsPaired(radio)
        Unpair(radio)
    WCL.Device.Pair(radio)

UnPair ( radio )
    If IsPaired(radio)
        WCL.Device.Unpair(radio)

IsPaired ( radio )
    WCL.Device.Paired(radio)

I usually see the Catastrophic failure message, about 3 out of every 4 pair attempts, however I saw this Out of Memory error once today and am not sure if it is related.

    System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
       at WCLX.wclBluetoothDevicexClass.get_Paired(wclBluetoothRadiox Radio)
       at wclnet.wclBluetoothDevice.Paired(wclBluetoothRadio Radio)

    System.Runtime.InteropServices.COMException (0x8000FFFF): Out of memory
       at WCLX.wclBluetoothDevicexClass.get_Paired(wclBluetoothRadiox Radio)
       at wclnet.wclBluetoothDevice.Paired(wclBluetoothRadio Radio)

This error happens on the latest release of the WCL, the version released on July 16th.

servel333:
After changing the below 3 function's flow, I found that this error now occurs when WCL.Device.Pair is called.


Pair ( radio, passkey )
    WCL.Device.Pair(radio)

UnPair ( radio )
    WCL.Device.Unpair(radio)

IsPaired ( radio )
    WCL.Device.Paired(radio)

Mike Petrichenko:
Can you please send me all your code part executes Pair function (with the code part establishes radio object and device object) as a forum private message (to protect your code from public).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Sitemap 1 2 3 4 5 6 7 
Go to full version