Made not knowing which device is the HMD a non-critical error
@@ -267,7 +267,7 @@ static int AttachInterface(SurviveViveData *sv, struct SurviveUSBInfo *usbObject
#else
struct libusb_transfer *tx = iface->transfer = libusb_alloc_transfer(0);
// printf( "%p %d %p %p\n", iface, which_interface_am_i, tx, devh );
- SV_INFO("Attaching %s(0x%x) for %s", hname, endpoint_num, assocobj->codename);
+ SV_INFO("Attaching %s(0x%x) for %s", hname, endpoint_num, assocobj ? assocobj->codename : "(unknown)");
if (!iface->transfer) {
SV_ERROR("Error: failed on libusb_alloc_transfer for %s", hname);
@@ -598,13 +598,14 @@ int survive_usb_init(SurviveViveData *sv) {
}
// There should only be one HMD, tie the mainboard interface to the surviveobject
+ if (hmd) {
for (int i = 0; i < sv->udev_cnt; i++) {
struct SurviveUSBInfo *usbInfo = &sv->udev[i];
if (USB_DEV_HMD == usbInfo->device_info->type) {
- assert(hmd);
usbInfo->so = hmd;
}
}
+ }
for (int i = 0; i < sv->udev_cnt; i++) {
struct SurviveUSBInfo *usbInfo = &sv->udev[i];
@@ -1868,6 +1869,9 @@ void survive_data_cb(SurviveUSBInterface *si) {
SurviveObject *obj = si->assoc_obj;
uint8_t *readdata = si->buffer;
+ if (iface == USB_IF_HMD_HEADSET_INFO && obj == 0)
+ return;
+
int id = POP1;
// printf( "%16s Size: %2d ID: %d / %d\n", si->hname, size, id, iface );
// SV_INFO("%s interface %d", obj->codename, iface);
