From 4.12 on, I’ve been polling the vr::Prop_DeviceIsWireless_Bool value to understand whether the SteamVR Controller is turned on or off. Previous to 4.15, it would return true when connected and false when disconnected. Now, in 4.15, it only returns true.
Not sure if it’s a SteamVR software issue that happened to coincide with the upgrade to 4.15, but I’m not sure where exactly to look to figure this out further.
Here’s the code I’ve been using to debug, inside \Engine\Plugins\Runtime\Steam\SteamVR\Source\SteamVR\Private\SteamVRHMD.cpp, inside my own debug function:
void FSteamVRHMD::DEBUGTEST()
{
for (int32 i = 0; i < 5; i++)
{
FString output;
char string[vr::k_unMaxPropertyStringSize] = "";
vr::ETrackedPropertyError propError;
int32 numchars;
UE_LOG(LogHMD, Log, TEXT("THIS IS DEBUGTEXT"));//TEXT("Warning: SteamVR Compositor had an error on present (%d)"), (int32)Error);
output = UKismetStringLibrary::Conv_BoolToString(VRSystem->GetBoolTrackedDeviceProperty(i, vr::Prop_DeviceIsWireless_Bool, &propError));
UE_LOG(LogHMD, Log, TEXT("Device (%d) connected wireless=%s, error=%d"), i, *output, (int32)propError);
output = UKismetStringLibrary::Conv_BoolToString(VRSystem->GetBoolTrackedDeviceProperty(i, vr::Prop_DeviceProvidesBatteryStatus_Bool, &propError));
UE_LOG(LogHMD, Log, TEXT("Device (%d) on desktopbattery=%s, error=%d"), i, *output, (int32)propError);
numchars = VRSystem->GetStringTrackedDeviceProperty(i, vr::Prop_AllWirelessDongleDescriptions_String, &string[0], vr::k_unMaxPropertyStringSize, &propError);
output = FString(ANSI_TO_TCHAR(string));
UE_LOG(LogHMD, Log, TEXT("Device (%d) dongle descrip=%s with %d chars, error=%d"), i, *output, numchars, (int32)propError);
numchars = VRSystem->GetStringTrackedDeviceProperty(i, vr::Prop_ConnectedWirelessDongle_String, &string[0], vr::k_unMaxPropertyStringSize, &propError);
output = FString(ANSI_TO_TCHAR(string));
UE_LOG(LogHMD, Log, TEXT("Device (%d) connected dongle=%s with %d chars, error=%d"), i, *output, numchars, (int32)propError);
numchars = VRSystem->GetStringTrackedDeviceProperty(i, vr::Prop_RenderModelName_String, &string[0], vr::k_unMaxPropertyStringSize, &propError);
output = FString(ANSI_TO_TCHAR(string));
UE_LOG(LogHMD, Log, TEXT("Device (%d) render model=%s with %d chars, error=%d"), i, *output, numchars, (int32)propError);
numchars = VRSystem->GetTrackedDeviceActivityLevel(i);
output = FString(ANSI_TO_TCHAR(string));
UE_LOG(LogHMD, Log, TEXT("Device (%d) activity level=%d"), i, numchars);
}
}
My actual code pulls this functionality to the SteamVRFunctionLibrary which exposes it to my game.
Any help would be appreciated.
Thanks,
Cameron