OneNightBlitz Posted July 12, 2022 Posted July 12, 2022 I'm currently developing an application using Unity Engine and OpenXR and I was hoping if there's a way I can access the battery levels for each controller.
JoeJ Posted July 12, 2022 Posted July 12, 2022 You should be able to listen for the event. I think there are several different battery events you can get access to. The Wave.Essence.Events has this api but I think there are others in the legacy plugin. SystemEvent.Listen(WVR_EventType.WVR_EventType_BatteryPercentageUpdate, OnBatteryEvent);
JoeJ Posted July 12, 2022 Posted July 12, 2022 Here is another API I just ran across that looks a bit easier: Interop.WVR_GetDeviceBatteryPercentage(WVR_DeviceType.WVR_DeviceType_HMD);
OneNightBlitz Posted July 13, 2022 Author Posted July 13, 2022 15 hours ago, JoeJ said: You should be able to listen for the event. I think there are several different battery events you can get access to. The Wave.Essence.Events has this api but I think there are others in the legacy plugin. SystemEvent.Listen(WVR_EventType.WVR_EventType_BatteryPercentageUpdate, OnBatteryEvent); 15 hours ago, JoeJ said: Here is another API I just ran across that looks a bit easier: Interop.WVR_GetDeviceBatteryPercentage(WVR_DeviceType.WVR_DeviceType_HMD); I tried both of these. The former keeps throwing me errors regarding a missing wave_api.dll regardless if the DLL is in the Assets folder or not. The latter just returns the value of 1 for any device type I use as a parameter. I feel like the GetDeviceBatteryPercentage Interop is not meant for either Cosmos or PCVR. Are there other methods I can try?
JoeJ Posted July 13, 2022 Posted July 13, 2022 10 hours ago, OneNightBlitz said: I feel like the GetDeviceBatteryPercentage Interop is not meant for either Cosmos or PCVR. Are there other methods I can try? I have used the eventing api on Native Focus3 apps only and I do get battery events but there are other events I have always thought I should see but do not. It seems like they would have support on Cosmos for something this simple but perhaps they have not added support for that device type in the SDK.
Alex_HTC Posted July 14, 2022 Posted July 14, 2022 On 7/13/2022 at 8:05 AM, JoeJ said: I have used the eventing api on Native Focus3 apps only and I do get battery events but there are other events I have always thought I should see but do not. It seems like they would have support on Cosmos for something this simple but perhaps they have not added support for that device type in the SDK. @JoeJ I suspect something like WVR_GetDeviceBatteryPercentage is something along the right lines?https://hub.vive.com/storage/docs/en-us/WVR_GetDeviceBatteryPercentage.html
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now