WVR_GetBatteryStatus¶
-
WVR_EXPORT WVR_BatteryStatus WVR_GetBatteryStatus(WVR_DeviceType type)
Get the status of remaining battery power.
- Return
- The status of the remaining battery power. Return WVR_BatteryStatus_Unknown if the device service cannot get the remaining battery power. (refer to WVR_BatteryStatus)
- Version
- API Level 1
- Parameters
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 remaining battery power of the HMD
WVR_BatteryStatus status;
status = WVR_GetBatteryStatus(WVR_DeviceType_HMD);
switch(status)
{
case WVR_BatteryStatus_Unknown:
LOGI("HMD remaining battery power is unknown.");
break;
case WVR_BatteryStatus_Normal:
LOGI("HMD remaining battery power is sufficient.");
break;
case WVR_BatteryStatus_Low:
LOGI("HMD remaining battery power is low. Please take note.");
break;
case WVR_BatteryStatus_UltraLow:
LOGI("HMD remaining battery power is really low. Please charge the HMD.");
break;
}
Battery Status includes the following below:
-
enum
WVR_BatteryStatus
¶ The remaining battery power status.
Values:
-
WVR_BatteryStatus_Unknown
= 0¶ Error code if the device service cannot get remaining battery power status.
-
WVR_BatteryStatus_Normal
= 1¶ Remaining battery power status is sufficient.
-
WVR_BatteryStatus_Low
= 2¶ Remaining battery power status is low.
-
WVR_BatteryStatus_UltraLow
= 3¶ Remaining battery power status is really low.
-