WVR_GetChargeStatus

WVR_EXPORT WVR_ChargeStatus WVR_GetChargeStatus(WVR_DeviceType type)

Get the current HMD battery charging status.

Return
The HMD battery charging status. Return WVR_ChargeStatus_Unknown if the device service cannot get the battery charging status of the HMD. (refer to WVR_ChargeStatus)
Version
API Level 1
Parameters
  • type: Type Device type to get the InputDeviceState. (refer to WVR_DeviceType)

How to use

Here is an example for the function:

#include <wvr/wvr_device.h>

// Get the HMD battery charging status

WVR_ChargeStatus status;
status = WVR_GetChargeStatus(WVR_DeviceType_HMD);

switch(status)
{
    case WVR_ChargeStatus_Unknown:
        LOGI("HMD battery charging status is unknown.");
        break;
    case WVR_ChargeStatus_Discharging:
        LOGI("HMD battery charging is discharging.");
        break;
    case WVR_ChargeStatus_Charging:
        LOGI("HMD battery is currently charging.");
        break;
    case WVR_ChargeStatus_Full:
        LOGI("HMD battery is full.");
        break;
}

Charge Status includes the following below:

enum WVR_ChargeStatus

The charging status.

Values:

WVR_ChargeStatus_Unknown = 0

Error code if the device service cannot get the charging status of the battery in use.

WVR_ChargeStatus_Discharging = 1

Device battery is discharging.

WVR_ChargeStatus_Charging = 2

Device battery is charging.

WVR_ChargeStatus_Full = 3

Device battery is full.