summaryrefslogtreecommitdiffhomepage
path: root/tracker-steamvr/steamvr.cpp
diff options
context:
space:
mode:
authorStanisław Halik <sthalik@misaki.pl>2017-05-14 16:22:09 +0200
committerGitHub <noreply@github.com>2017-05-14 16:22:09 +0200
commit5c23666b58bb1dd4aea15c0d62a2f716d5be7f52 (patch)
treee6497e9b55c073be209ec673ef05e62bf57a2c8f /tracker-steamvr/steamvr.cpp
parent4701dd3b0c8323a11cf7d5ad09c579a9864a41bd (diff)
parentc392181211b245e74292424500265323c960c1aa (diff)
Merge branch 'unstable' into unstable
Diffstat (limited to 'tracker-steamvr/steamvr.cpp')
-rw-r--r--tracker-steamvr/steamvr.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp
index d32c9d44..43bccdb8 100644
--- a/tracker-steamvr/steamvr.cpp
+++ b/tracker-steamvr/steamvr.cpp
@@ -55,16 +55,21 @@ void device_list::fill_device_specs(QList<device_spec>& list)
device_states, vr::k_unMaxTrackedDeviceCount);
static constexpr unsigned bufsiz = vr::k_unTrackingStringSize;
- static char str[bufsiz] {}; // vr_lock prevents reentrancy
+ static char str[bufsiz+1] {}; // vr_lock prevents reentrancy
for (unsigned k = 0; k < vr::k_unMaxTrackedDeviceCount; k++)
{
- if (v->GetTrackedDeviceClass(k) == vr::ETrackedDeviceClass::TrackedDeviceClass_Invalid ||
- v->GetTrackedDeviceClass(k) == vr::ETrackedDeviceClass::TrackedDeviceClass_TrackingReference)
+ if (v->GetTrackedDeviceClass(k) == vr::ETrackedDeviceClass::TrackedDeviceClass_Invalid)
+ {
+ qDebug() << "no device with index";
continue;
+ }
if (!device_states[k].bDeviceIsConnected)
+ {
+ qDebug() << "device not connected but proceeding";
continue;
+ }
unsigned len;
@@ -92,6 +97,8 @@ void device_list::fill_device_specs(QList<device_spec>& list)
dev.type = "HMD"; break;
case vr::ETrackedDeviceClass::TrackedDeviceClass_Controller:
dev.type = "Controller"; break;
+ case vr::ETrackedDeviceClass::TrackedDeviceClass_TrackingReference:
+ dev.type = "Tracker"; break;
default:
dev.type = "Unknown"; break;
}