The open source OpenXR runtime
0
fork

Configure Feed

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

d/wmr: Update comments in controller_base

Expand some comments about what different packets do and fix
the description of controller connection lifetimes

authored by

Jan Schmidt and committed by
Jakob Bornecrantz
4b4fc2b7 7009c643

+9 -7
+3 -3
src/xrt/drivers/wmr/wmr_controller_base.c
··· 562 562 }; 563 563 struct wmr_controller_fw_cmd_response fw_cmd_response; 564 564 565 - /* Zero command. Clears controller state? */ 565 + /* Zero command. Reinits controller internal state */ 566 566 fw_cmd = WMR_CONTROLLER_FW_CMD_INIT(0x06, 0x0, 0, 0); 567 567 if (wmr_controller_send_fw_cmd(wcb, &fw_cmd, 0x06, &fw_cmd_response) < 0) { 568 568 return false; 569 569 } 570 570 571 - /* Unknown what this one does. No obvious effect */ 571 + /* Quiesce/restart controller tasks */ 572 572 fw_cmd = WMR_CONTROLLER_FW_CMD_INIT(0x06, 0x04, 0xc1, 0x02); 573 573 if (wmr_controller_send_fw_cmd(wcb, &fw_cmd, 0x06, &fw_cmd_response) < 0) { 574 574 return false; ··· 579 579 return false; 580 580 } 581 581 582 - /* Enable the status reports, IMU and touchpad */ 582 + /* Enable the status reports, IMU and control status reports */ 583 583 const unsigned char wmr_controller_status_enable_cmd[64] = {0x06, 0x03, 0x01, 0x00, 0x02}; 584 584 wmr_controller_send_bytes(wcb, wmr_controller_status_enable_cmd, sizeof(wmr_controller_status_enable_cmd)); 585 585 const unsigned char wmr_controller_imu_on_cmd[64] = {0x06, 0x03, 0x02, 0xe1, 0x02};
+6 -4
src/xrt/drivers/wmr/wmr_controller_base.h
··· 38 38 * The controller implementation doesn't need to care how 39 39 * the communication is implemented. 40 40 * 41 - * The connection is reference counted and mutex protected, 42 - * as both the controller and the connection implementation 43 - * may need to hold a reference to it, and to detach 44 - * safely when shutting down. 41 + * The HMD-tunnelled version of the connection is reference 42 + * counted and mutex protected, as both the controller and 43 + * the HMD need to hold a reference to it to clean up safely. 44 + * For bluetooth controllers, destruction of the controller 45 + * xrt_device calls disconnect and destroys the connection 46 + * object (and bluetooth listener) immediately. 45 47 */ 46 48 struct wmr_controller_connection 47 49 {