OVR_ErrorCode.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /********************************************************************************//**
  2. \file OVR_ErrorCode.h
  3. \brief This header provides LibOVR error code declarations.
  4. \copyright Copyright 2015 Oculus VR, LLC All Rights reserved.
  5. *************************************************************************************/
  6. #ifndef OVR_ErrorCode_h
  7. #define OVR_ErrorCode_h
  8. #include "OVR_Version.h"
  9. #include <stdint.h>
  10. #ifndef OVR_RESULT_DEFINED
  11. #define OVR_RESULT_DEFINED ///< Allows ovrResult to be independently defined.
  12. /// API call results are represented at the highest level by a single ovrResult.
  13. typedef int32_t ovrResult;
  14. #endif
  15. /// \brief Indicates if an ovrResult indicates success.
  16. ///
  17. /// Some functions return additional successful values other than ovrSucces and
  18. /// require usage of this macro to indicate successs.
  19. ///
  20. #if !defined(OVR_SUCCESS)
  21. #define OVR_SUCCESS(result) (result >= 0)
  22. #endif
  23. /// \brief Indicates if an ovrResult indicates an unqualified success.
  24. ///
  25. /// This is useful for indicating that the code intentionally wants to
  26. /// check for result == ovrSuccess as opposed to OVR_SUCCESS(), which
  27. /// checks for result >= ovrSuccess.
  28. ///
  29. #if !defined(OVR_UNQUALIFIED_SUCCESS)
  30. #define OVR_UNQUALIFIED_SUCCESS(result) (result == ovrSuccess)
  31. #endif
  32. /// \brief Indicates if an ovrResult indicates failure.
  33. ///
  34. #if !defined(OVR_FAILURE)
  35. #define OVR_FAILURE(result) (!OVR_SUCCESS(result))
  36. #endif
  37. // Success is a value greater or equal to 0, while all error types are negative values.
  38. #ifndef OVR_SUCCESS_DEFINED
  39. #define OVR_SUCCESS_DEFINED ///< Allows ovrResult to be independently defined.
  40. typedef enum ovrSuccessType_
  41. {
  42. /// This is a general success result. Use OVR_SUCCESS to test for success.
  43. ovrSuccess = 0,
  44. /// Returned from a call to SubmitFrame. The call succeeded, but what the app
  45. /// rendered will not be visible on the HMD. Ideally the app should continue
  46. /// calling SubmitFrame, but not do any rendering. When the result becomes
  47. /// ovrSuccess, rendering should continue as usual.
  48. ovrSuccess_NotVisible = 1000,
  49. ovrSuccess_HMDFirmwareMismatch = 4100, ///< The HMD Firmware is out of date but is acceptable.
  50. ovrSuccess_TrackerFirmwareMismatch = 4101, ///< The Tracker Firmware is out of date but is acceptable.
  51. ovrSuccess_ControllerFirmwareMismatch = 4104, ///< The controller firmware is out of date but is acceptable.
  52. } ovrSuccessType;
  53. #endif
  54. typedef enum ovrErrorType_
  55. {
  56. /* General errors */
  57. ovrError_MemoryAllocationFailure = -1000, ///< Failure to allocate memory.
  58. ovrError_SocketCreationFailure = -1001, ///< Failure to create a socket.
  59. ovrError_InvalidSession = -1002, ///< Invalid ovrSession parameter provided.
  60. ovrError_Timeout = -1003, ///< The operation timed out.
  61. ovrError_NotInitialized = -1004, ///< The system or component has not been initialized.
  62. ovrError_InvalidParameter = -1005, ///< Invalid parameter provided. See error info or log for details.
  63. ovrError_ServiceError = -1006, ///< Generic service error. See error info or log for details.
  64. ovrError_NoHmd = -1007, ///< The given HMD doesn't exist.
  65. /* Audio error range, reserved for Audio errors. */
  66. ovrError_AudioReservedBegin = -2000, ///< First Audio error.
  67. ovrError_AudioDeviceNotFound = -2001, ///< Failure to find the specified audio device.
  68. ovrError_AudioComError = -2002, ///< Generic COM error.
  69. ovrError_AudioReservedEnd = -2999, ///< Last Audio error.
  70. /* Initialization errors. */
  71. ovrError_Initialize = -3000, ///< Generic initialization error.
  72. ovrError_LibLoad = -3001, ///< Couldn't load LibOVRRT.
  73. ovrError_LibVersion = -3002, ///< LibOVRRT version incompatibility.
  74. ovrError_ServiceConnection = -3003, ///< Couldn't connect to the OVR Service.
  75. ovrError_ServiceVersion = -3004, ///< OVR Service version incompatibility.
  76. ovrError_IncompatibleOS = -3005, ///< The operating system version is incompatible.
  77. ovrError_DisplayInit = -3006, ///< Unable to initialize the HMD display.
  78. ovrError_ServerStart = -3007, ///< Unable to start the server. Is it already running?
  79. ovrError_Reinitialization = -3008, ///< Attempting to re-initialize with a different version.
  80. ovrError_MismatchedAdapters = -3009, ///< Chosen rendering adapters between client and service do not match
  81. ovrError_LeakingResources = -3010, ///< Calling application has leaked resources
  82. ovrError_ClientVersion = -3011, ///< Client version too old to connect to service
  83. ovrError_OutOfDateOS = -3012, ///< The operating system is out of date.
  84. ovrError_OutOfDateGfxDriver = -3013, ///< The graphics driver is out of date.
  85. ovrError_IncompatibleGPU = -3014, ///< The graphics hardware is not supported
  86. ovrError_NoValidVRDisplaySystem = -3015, ///< No valid VR display system found.
  87. /* Hardware errors */
  88. ovrError_InvalidBundleAdjustment = -4000, ///< Headset has no bundle adjustment data.
  89. ovrError_USBBandwidth = -4001, ///< The USB hub cannot handle the camera frame bandwidth.
  90. ovrError_USBEnumeratedSpeed = -4002, ///< The USB camera is not enumerating at the correct device speed.
  91. ovrError_ImageSensorCommError = -4003, ///< Unable to communicate with the image sensor.
  92. ovrError_GeneralTrackerFailure = -4004, ///< We use this to report various tracker issues that don't fit in an easily classifiable bucket.
  93. ovrError_ExcessiveFrameTruncation = -4005, ///< A more than acceptable number of frames are coming back truncated.
  94. ovrError_ExcessiveFrameSkipping = -4006, ///< A more than acceptable number of frames have been skipped.
  95. ovrError_SyncDisconnected = -4007, ///< The tracker is not receiving the sync signal (cable disconnected?)
  96. ovrError_TrackerMemoryReadFailure = -4008, ///< Failed to read memory from the tracker
  97. ovrError_TrackerMemoryWriteFailure = -4009, ///< Failed to write memory from the tracker
  98. ovrError_TrackerFrameTimeout = -4010, ///< Timed out waiting for a camera frame
  99. ovrError_TrackerTruncatedFrame = -4011, ///< Truncated frame returned from tracker
  100. ovrError_HMDFirmwareMismatch = -4100, ///< The HMD Firmware is out of date and is unacceptable.
  101. ovrError_TrackerFirmwareMismatch = -4101, ///< The Tracker Firmware is out of date and is unacceptable.
  102. ovrError_BootloaderDeviceDetected = -4102, ///< A bootloader HMD is detected by the service
  103. ovrError_TrackerCalibrationError = -4103, ///< The tracker calibration is missing or incorrect
  104. ovrError_ControllerFirmwareMismatch = -4104, ///< The controller firmware is out of date and is unacceptable
  105. /* Synchronization errors */
  106. ovrError_Incomplete = -5000, ///<Requested async work not yet complete.
  107. ovrError_Abandoned = -5001, ///<Requested async work was abandoned and result is incomplete.
  108. /* Rendering errors */
  109. ovrError_DisplayLost = -6000, ///<In the event of a system-wide graphics reset or cable unplug this is returned to the app
  110. /* Fatal errors */
  111. ovrError_RuntimeException = -7000, ///< A runtime exception occurred. The application is required to shutdown LibOVR and re-initialize it before this error state will be cleared.
  112. } ovrErrorType;
  113. #endif /* OVR_ErrorCode_h */