FailedDeviceΒΆ

Properties:

Methods:

class Leap::FailedDevice

The FailedDevice class provides information about Leap Motion hardware that has been physically connected to the client computer, but is not operating correctly.

Failed devices do not provide any tracking data and do not show up in the Controller:devices() list.

Get the list of failed devices using Controller::failedDevices().

public void  OnDeviceFailure (Object sender, DeviceFailureEventArgs e)
{
    Controller controller = sender as Controller;
    FailedDeviceList badDevices = controller.FailedDevices();
    foreach(FailedDevice badDevice in badDevices){
        string failureReason = "";
        switch (badDevice.Failure) {
            case FailedDevice.FailureType.FAIL_CALIBRATION:
                failureReason = "has bad calibration record.";
                break;
            case FailedDevice.FailureType.FAIL_CONTROL:
                failureReason = "failed to establish USB control interfaces.";
                break;
            case FailedDevice.FailureType.FAIL_FIRMWARE:
                failureReason = "has corrupt firmware or failed to update";
                break;
            case FailedDevice.FailureType.FAIL_TRANSPORT:
                failureReason = "not responding.";
                break;
            case FailedDevice.FailureType.FAIL_UNKNOWN:
                failureReason = "failed for unknown reason.";
                break;
        }
        Console.WriteLine ("USB device with pnpID: " + badDevice.PnpId + " " + failureReason);
    }
}

Since
3.0

Public Type

FailureType enum

The errors that can cause a device to fail to properly connect to the service.

Since
3.0

Values:

  • FAIL_UNKNOWN -

    The cause of the error is unknown.

    Since

    3.0

  • FAIL_CALIBRATION -

    The device has a bad calibration record.

    Since

    3.0

  • FAIL_FIRMWARE -

    The device firmware is corrupt or failed to update.

    Since

    3.0

  • FAIL_TRANSPORT -

    The device is unresponsive.

    Since

    3.0

  • FAIL_CONTROL -

    The service cannot establish the required USB control interfaces.

    Since

    3.0

  • FAIL_COUNT -

    Not currently used.

    Since

    3.0

Public Functions

bool Equals(FailedDevice other)

Test FailedDevice equality.

True if the devices are the same.

Since
3.0

Property

FailedDevice.FailureType Failure

The reason for device failure.

The failure reasons are defined as members of the FailureType enumeration:

FailureType::FAIL_UNKNOWN The cause of the error is unknown.

FailureType::FAIL_CALIBRATION The device has a bad calibration record.

FailureType::FAIL_FIRMWARE The device firmware is corrupt or failed to update.

FailureType::FAIL_TRANSPORT The device is unresponsive.

FailureType::FAIL_CONTROL The service cannot establish the required USB control interfaces.

FailureType::FAIL_COUNT Not currently used.

Since
3.0

string PnpId

The device plug-and-play id string.

Since
3.0