Forum Discussion
SiSShadowman
13 years agoHonored Guest
Correct usage of OVR::DeviceManager::EnumerateDevices<>
Hi guys, I'm currently writing a C# wrapper for the SDK, however my developer kit has not arrived yet, so I can't really test my code. However a friend of mine is currently testing it, and for some...
kojack
13 years agoMVP
It's hard for me to say definitely, since I don't have a rift for it to enumerate so I can't debug the code, but the sdk code looks like it might be wrong.
Here's the code of IsAvailable:
The current enumerated device is available if it has been enumerated and it's lock has a manager.
Doing Next() on it will iterate through the next devices in the list, skipping any already enumerated ones.
The problem is that I can't find anywhere that ever sets Enumerated to true. Ok, there's a place that does, but it's in EnumerateFactoryDevices(), which isn't used when you are manually enumerating individual devices. I'd guess that DeviceHandle::enumerateNext() is where Enumerated should be set to true, since that's the bit that iterates through the devices.
Although maybe I'm just missing the intention of the code and this is correct behaviour. The comments are a bit thin.
Here's the code of IsAvailable:
bool DeviceHandle::IsAvailable() const
{
// This isn't "atomically safe", but the function only returns the
// recent state that may change.
return pImpl ? (pImpl->Enumerated && pImpl->pLock->pManager) : false;
}
The current enumerated device is available if it has been enumerated and it's lock has a manager.
Doing Next() on it will iterate through the next devices in the list, skipping any already enumerated ones.
The problem is that I can't find anywhere that ever sets Enumerated to true. Ok, there's a place that does, but it's in EnumerateFactoryDevices(), which isn't used when you are manually enumerating individual devices. I'd guess that DeviceHandle::enumerateNext() is where Enumerated should be set to true, since that's the bit that iterates through the devices.
Although maybe I'm just missing the intention of the code and this is correct behaviour. The comments are a bit thin.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago
- 4 months ago
- 1 year ago