[4de1c7]: / app / resources / LeapSDK / v3_python27 / src / FailedDevice.cs

Download this file

109 lines (101 with data), 3.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
/******************************************************************************\
* Copyright (C) 2012-2016 Leap Motion, Inc. All rights reserved. *
* Leap Motion proprietary and confidential. Not for distribution. *
* Use subject to the terms of the Leap Motion SDK Agreement available at *
* https://developer.leapmotion.com/sdk_agreement, or another agreement *
* between Leap Motion and you, your company or other organization. *
\******************************************************************************/
namespace Leap
{
using System;
using System.Runtime.InteropServices;
/**
* 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().
*
* \include FailedDevice_class.txt
*
* @since 3.0
*/
//TODO Implement FailedDevices
public class FailedDevice:
IEquatable<FailedDevice>
{
public FailedDevice() {
Failure = FailureType.FAIL_UNKNOWN;
PnpId = "0";
}
/**
* Test FailedDevice equality.
* True if the devices are the same.
* @since 3.0
*/
public bool Equals(FailedDevice other)
{
return this.PnpId == other.PnpId;
}
/**
* The device plug-and-play id string.
* @since 3.0
*/
public string PnpId { get; private set; }
/**
* 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
*/
public FailedDevice.FailureType Failure { get; private set; }
/**
* The errors that can cause a device to fail to properly connect to the service.
*
* @since 3.0
*/
public enum FailureType
{
/** The cause of the error is unknown.
* @since 3.0
*/
FAIL_UNKNOWN,
/** The device has a bad calibration record.
* @since 3.0
*/
FAIL_CALIBRATION,
/** The device firmware is corrupt or failed to update.
* @since 3.0
*/
FAIL_FIRMWARE,
/** The device is unresponsive.
* @since 3.0
*/
FAIL_TRANSPORT,
/** The service cannot establish the required USB control interfaces.
* @since 3.0
*/
FAIL_CONTROL,
/** Not currently used.
* @since 3.0
*/
FAIL_COUNT
}
}
}