The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/vive: Use VIVE_ERROR when vive_device is available.

+18 -13
+2 -2
src/xrt/drivers/vive/vive_config.c
··· 220 220 221 221 cJSON *json = cJSON_Parse(json_string); 222 222 if (!cJSON_IsObject(json)) { 223 - U_LOG_E("Could not parse JSON data."); 223 + VIVE_ERROR(d, "Could not parse JSON data."); 224 224 return false; 225 225 } 226 226 ··· 263 263 264 264 d->display.imuref = imu_to_head; 265 265 } break; 266 - default: U_LOG_E("Unknown Vive variant."); return false; 266 + default: VIVE_ERROR(d, "Unknown Vive variant."); return false; 267 267 } 268 268 269 269 JSON_STRING(json, "model_number", d->firmware.model_number);
+16 -11
src/xrt/drivers/vive/vive_device.c
··· 388 388 angular_velocity_fixed.z = -angular_velocity.z; 389 389 angular_velocity = angular_velocity_fixed; 390 390 } break; 391 - default: U_LOG_E("Unhandled Vive variant"); return; 391 + default: VIVE_ERROR(d, "Unhandled Vive variant"); return; 392 392 } 393 393 394 394 d->imu.time_ns += dt_ns; ··· 421 421 return true; 422 422 } 423 423 if (ret < 0) { 424 - U_LOG_E("Failed to read device '%i'!", ret); 424 + VIVE_ERROR(d, "Failed to read device '%i'!", ret); 425 425 return false; 426 426 } 427 427 428 428 switch (buffer[0]) { 429 429 case VIVE_MAINBOARD_STATUS_REPORT_ID: 430 430 if (ret != sizeof(struct vive_mainboard_status_report)) { 431 - U_LOG_E("Mainboard status report has invalid size."); 431 + VIVE_ERROR(d, 432 + "Mainboard status report has invalid size."); 432 433 return false; 433 434 } 434 435 vive_mainboard_decode_message( 435 436 d, (struct vive_mainboard_status_report *)buffer); 436 437 break; 437 - default: U_LOG_E("Unknown mainboard message type %d", buffer[0]); break; 438 + default: 439 + VIVE_ERROR(d, "Unknown mainboard message type %d", buffer[0]); 440 + break; 438 441 } 439 442 440 443 return true; ··· 478 481 return true; 479 482 } 480 483 if (ret < 0) { 481 - U_LOG_E("Failed to read device '%i'!", ret); 484 + VIVE_ERROR(d, "Failed to read device '%i'!", ret); 482 485 return false; 483 486 } 484 487 485 488 switch (buffer[0]) { 486 489 case VIVE_IMU_REPORT_ID: 487 490 if (ret != 52) { 488 - U_LOG_E("Wrong IMU report size: %d", ret); 491 + VIVE_ERROR(d, "Wrong IMU report size: %d", ret); 489 492 return false; 490 493 } 491 494 update_imu(d, (struct vive_imu_report *)buffer); 492 495 break; 493 - default: U_LOG_E("Unknown sensor message type %d", buffer[0]); break; 496 + default: 497 + VIVE_ERROR(d, "Unknown sensor message type %d", buffer[0]); 498 + break; 494 499 } 495 500 496 501 return true; ··· 670 675 fov, h_meters, 671 676 (double)d->base.hmd->views[eye].lens_center.y_meters, 0, 672 677 &d->base.hmd->views[eye].fov)) { 673 - U_LOG_E( 674 - "Failed to compute the partial fields of view."); 678 + VIVE_ERROR( 679 + d, "Failed to compute the partial fields of view."); 675 680 free(d); 676 681 return NULL; 677 682 } ··· 698 703 ret = os_thread_helper_start(&d->mainboard_thread, 699 704 vive_mainboard_run_thread, d); 700 705 if (ret != 0) { 701 - U_LOG_E("Failed to start mainboard thread!"); 706 + VIVE_ERROR(d, "Failed to start mainboard thread!"); 702 707 vive_device_destroy((struct xrt_device *)d); 703 708 return NULL; 704 709 } ··· 707 712 ret = os_thread_helper_start(&d->sensors_thread, 708 713 vive_sensors_run_thread, d); 709 714 if (ret != 0) { 710 - U_LOG_E("Failed to start sensors thread!"); 715 + VIVE_ERROR(d, "Failed to start sensors thread!"); 711 716 vive_device_destroy((struct xrt_device *)d); 712 717 return NULL; 713 718 }