WVR_GetDeviceErrorStatus

Warning

doxygenfunction: Cannot find function “WVR_GetDeviceErrorStatus” in doxygen xml output for project “vrm” from directory: ../../../API_Reference/generated/xml/

How to use

Here is an example for the function:

#include <wvr/wvr_device.h>

// To get the current error states of the device.

WVR_DeviceErrorStatus status;
status = WVR_GetDeviceErrorStatus(WVR_DeviceType_HMD);

if ( status != WVR_DeviceErrorStatus_None ) {
    if ( status & WVR_DeviceErrorStatus_BatteryOverheat == WVR_DeviceErrorStatus_BatteryOverheat ) {
        LOGW("The temperature of battery on HMD is hot.");
    }

    if ( status & WVR_DeviceErrorStatus_BatteryOvervoltage == WVR_DeviceErrorStatus_BatteryOvervoltage ) {
        LOGW("The battery is overvoltage charging.");
    }

    if ( status & WVR_DeviceErrorStatus_DeviceConnectFail == WVR_DeviceErrorStatus_DeviceConnectFail ) {
        LOGW("Cannot connect to HMD device.");
    }

    if ( status & WVR_DeviceErrorStatus_ChargeFail == WVR_DeviceErrorStatus_ChargeFail ) {
        LOGW("The battery of HMD cannot charge.");
    }

    if ( status & WVR_DeviceErrorStatus_DeviceLostTracking == WVR_DeviceErrorStatus_DeviceLostTracking ) {
        LOGW("HMD is lost tracking.");
    }
} else {
    LOGI("HMD device is normal.");
}

Device Error Status includes the following below:

enum WVR_DeviceErrorStatus

The error status of the specified device from the device service.

The device service uses bitmask to record the device error, because many errors might occur at the same time. Each error status represents a hardware exception for the device. The restore status means that the error status has been fixed.

Values:

WVR_DeviceErrorStatus_None = 0

Status of the device service is normal.

WVR_DeviceErrorStatus_BatteryOverheat = 1

Battery temperature is too hot.

WVR_DeviceErrorStatus_BatteryOverheatRestore = 1 << 1

Battery temperature has cooled down.

WVR_DeviceErrorStatus_BatteryOvervoltage = 1 << 2

Battery is overvoltage when charging.

WVR_DeviceErrorStatus_BatteryOvervoltageRestore = 1 << 3

Overvoltage has been fixed.

WVR_DeviceErrorStatus_DeviceConnectFail = 1 << 4

Failed to connect to the USB device.

WVR_DeviceErrorStatus_DeviceConnectRestore = 1 << 5

Connection failure has been fixed.

WVR_DeviceErrorStatus_DeviceLostTracking = 1 << 6

The device being tracked might be out of range.

WVR_DeviceErrorStatus_DeviceTrackingRestore = 1 << 7

Lost tracking has been fixed.

WVR_DeviceErrorStatus_ChargeFail = 1 << 8

The consumed voltage is larger than the charging voltage when the device is charging.

WVR_DeviceErrorStatus_ChargeRestore = 1 << 9

Charging failure has been fixed.