|
Monado OpenXR Runtime
|
Vive Pro 2 HID protocol definitions. More...

Go to the source code of this file.
Data Structures | |
| struct | vp2_feature_header |
| Header of the binary commands, the payload follows. More... | |
| struct | vp2_config_read_request |
| Request for VP2_COMMAND_CONFIG_READ and VP2_COMMAND_LOG_READ, sent after the report ID. More... | |
| struct | vp2_transfer_start |
| Payload of the start step of a write transfer. More... | |
| struct | vp2_feature_event |
| Payload of VP2_COMMAND_FEATURE_EVENT. More... | |
| struct | vp2_feature_state |
| Read with a VP2_REPORT_ID_FEATURE feature report, the MCU fills in the header itself. More... | |
| struct | vp2_status_report |
| Status report, sent every 50ms while VP2_FEATURE_EVENT_STATUS_REPORT is enabled. More... | |
| struct | vp2_config_header |
| Header of the config blob, the JSON follows. More... | |
Macros | |
| #define | VP2_DATA_SIZE 64 |
| Size of every report, including the report ID. | |
| #define | VP2_PAYLOAD_SIZE 60 |
| Largest payload after struct vp2_feature_header, larger ones are rejected with VP2_ACK_INVALID. | |
| #define | VP2_ACK_OK "1" |
| Replies of commands that only acknowledge, as ASCII after a struct vp2_feature_header with the same report ID and command. | |
| #define | VP2_ACK_FAILED "-1" |
| #define | VP2_ACK_INVALID "-22" |
| #define | VP2_TRANSFER_COMMAND(family, step) ((uint16_t)(((family) << 8) | (step))) |
| #define | VP2_TRANSFER_CRC_SEED 0x56697665u |
| Starting value of the transfer CRC-32, "Vive" in ASCII. In zlib terms the CRC is crc32(VP2_TRANSFER_CRC_SEED, data). | |
| #define | VP2_CONFIG_HEADER_SIZE 128 |
| Size of the header in front of the JSON in the config blob, struct vp2_config_header. | |
| #define | VP2_CONFIG_MAX_SIZE 0x8000 |
| Largest config blob the MCU will return, including the header. | |
| #define | VP2_CONFIG_MAGIC 0x3EE4DFDCu |
| Magic of struct vp2_config_header, the CRC-32 of "viveconfig". | |
| #define | VP2_FEATURE_EVENT_STATUS_REPORT (1ull << 0) |
| Valid mask bits of struct vp2_feature_event. | |
| #define | VP2_FEATURE_EVENT_AMP_GAIN (1ull << 1) |
| #define | VP2_FEATURE_EVENT_BRIGHTNESS_REFRESH (1ull << 2) |
| #define | VP2_FEATURE_EVENT_AMP_POWER_LIMIT (1ull << 3) |
| #define | VP2_FEATURE_EVENT_AUDIO_ROUTE (1ull << 5) |
| #define | VP2_FEATURE_EVENT_AUDIO_PROFILE (1ull << 6) |
| #define | VP2_FEATURE_EVENT_DISPLAY_POWER (1ull << 48) |
| #define | VP2_FEATURE_EVENT_POWER_STATE (1ull << 49) |
| #define | VP2_FEATURE_EVENT_PROXIMITY_OVERRIDE (1ull << 50) |
| #define | VP2_FEATURE_EVENT_WIRELESS_AUTH (1ull << 51) |
| #define | VP2_FEATURE_EVENT_THERMAL_WATCHDOG (1ull << 62) |
| #define | VP2_DISPLAY_POWER_XOR 0xC4 |
| #define | VP2_POWER_STATE_XOR 0x78 |
| #define | VP2_PROXIMITY_OVERRIDE_XOR 0x10 |
| #define | VP2_THERMAL_WATCHDOG_XOR 0x80 |
| #define | VP2_PROXIMITY_THRESHOLD 150 |
| Proximity values above this mean the headset is being worn. | |
| #define | VP2_IPD_UNIT_METERS 0.00001f |
| Unit of vp2_status_report::ipd in meters. | |
Vive Pro 2 HID protocol definitions.
| #define VP2_ACK_OK "1" |
Replies of commands that only acknowledge, as ASCII after a struct vp2_feature_header with the same report ID and command.
Unknown commands get VP2_ACK_INVALID.
| #define VP2_CONFIG_HEADER_SIZE 128 |
Size of the header in front of the JSON in the config blob, struct vp2_config_header.
| #define VP2_CONFIG_MAGIC 0x3EE4DFDCu |
Magic of struct vp2_config_header, the CRC-32 of "viveconfig".
| #define VP2_CONFIG_MAX_SIZE 0x8000 |
Largest config blob the MCU will return, including the header.
| #define VP2_DATA_SIZE 64 |
Size of every report, including the report ID.
| #define VP2_FEATURE_EVENT_STATUS_REPORT (1ull << 0) |
Valid mask bits of struct vp2_feature_event.
Bits 4 and 63 are accepted but do nothing.
VP2_FEATURE_EVENT_PROXIMITY_OVERRIDE and VP2_FEATURE_EVENT_WIRELESS_AUTH are only handled in wireless mode. The auth token is big endian, bit 7 of the first byte is a separate flag and the other 23 bits have to match the top 23 bits of the CRC-32 of the MCU's 12 character serial number (generated from its unique ID) followed by vp2_status_report::nonce. Once accepted the proximity override is honoured until the authentication times out.
VP2_FEATURE_EVENT_THERMAL_WATCHDOG controls a check that runs every 5 seconds: the MCU stops feeding its watchdog, and so resets itself, while vp2_status_report::thermal_adc is nonzero and below 0x371.
| #define VP2_IPD_UNIT_METERS 0.00001f |
Unit of vp2_status_report::ipd in meters.
| #define VP2_PAYLOAD_SIZE 60 |
Largest payload after struct vp2_feature_header, larger ones are rejected with VP2_ACK_INVALID.
| #define VP2_PROXIMITY_THRESHOLD 150 |
Proximity values above this mean the headset is being worn.
| #define VP2_TRANSFER_CRC_SEED 0x56697665u |
Starting value of the transfer CRC-32, "Vive" in ASCII. In zlib terms the CRC is crc32(VP2_TRANSFER_CRC_SEED, data).
| enum vp2_audio_button |
Audio buttons in struct vp2_status_report, only one is reported at a time.
| enum vp2_command |
Binary commands, the sub_id of struct vp2_feature_header.
VP2_COMMAND_DISPLAY_REQUEST takes an ASCII request and is handled in the background, one at a time. Requests that arrive while one is still running are dropped. Some of them:
| Enumerator | |
|---|---|
| VP2_COMMAND_GET_SOFTWARE_VERSION | Replies with the MCU version as 16 hex digits, e.g. "0000000000203056" |
| VP2_COMMAND_DISPLAY_REQUEST | ASCII display request, see above, no reply. |
| VP2_COMMAND_CODEC_REQUEST | "codecreg=<reg>,<value>" or "hpampreg=<reg>,<value>" in hex, no reply |
| VP2_COMMAND_FEATURE_EVENT | struct vp2_feature_event, no reply |
| VP2_COMMAND_FEATURE_STATE | struct vp2_feature_state, read as a feature report |
| VP2_COMMAND_STATUS_REPORT | struct vp2_status_report |
| VP2_COMMAND_DEBUG_REPORT | Named by the HTC driver, never sent by the MCU. |
| VP2_COMMAND_SYSTEM_REBOOT | Replies with VP2_ACK_OK, then resets the MCU. |
| VP2_COMMAND_REPORT | Named by the HTC driver, never sent by the MCU. |
| VP2_COMMAND_LOG_READ_START | Replies with the size of the log as a __le32, 0xFFFFFFFF if none. |
| VP2_COMMAND_LOG_READ | struct vp2_config_read_request, replies with up to 60 bytes |
| VP2_COMMAND_LOG_READ_ABORT | Replies with a __le32 0. |
| VP2_COMMAND_LOG_READ_END | Replies with a __le32 0. |
| VP2_COMMAND_CONFIG_READ_START | Replies with the size of the config blob as a __le32. |
| VP2_COMMAND_CONFIG_READ | struct vp2_config_read_request, replies with up to 60 bytes |
| VP2_COMMAND_CONFIG_READ_ABORT | Replies with a __le32 0. |
| VP2_COMMAND_CONFIG_READ_END | Replies with a __le32 0. |
| enum vp2_display_flags |
Bits of vp2_feature_state::display_flags.
| enum vp2_power_state |
Power states for VP2_FEATURE_EVENT_POWER_STATE, the HTC driver uses ready, idle and standby.
1 is treated the same as ready.
| enum vp2_report_id |
Report IDs.
VP2_REPORT_ID_COMMAND and VP2_REPORT_ID_FEATURE carry the same binary commands (struct vp2_feature_header followed by the payload), the MCU handles them the same way. Commands that reply do so with an input report on the same ID.
VP2_REPORT_ID_STRING takes an ASCII command right after the report ID and replies with [id][size][ascii]. The commands start with "mfg-", "usr-" or "eng-". "mfg-r-" reads factory data and "mfg-s-" queries the hardware, but "mfg-s-" also has commands that reboot or write protect the MCU. Unknown commands reply with "-22". For example:
| Enumerator | |
|---|---|
| VP2_REPORT_ID_COMMAND | Binary commands as output reports. |
| VP2_REPORT_ID_STRING | ASCII commands. |
| VP2_REPORT_ID_STATUS | struct vp2_status_report |
| VP2_REPORT_ID_FEATURE | Binary commands as feature reports, reading it returns struct vp2_feature_state. |
Bits of vp2_feature_event::thermal_watchdog, before the XOR.
| Enumerator | |
|---|---|
| VP2_THERMAL_WATCHDOG_SKIP_CHECK | Don't check the thermal ADC. |
| VP2_THERMAL_WATCHDOG_ALWAYS_FEED | Keep feeding the watchdog whatever the thermal ADC says. |
| enum vp2_transfer_family |
Transfers, the family is the high byte of the command and the step is the low byte, see VP2_TRANSFER_COMMAND.
Write transfers start with struct vp2_transfer_start, send the data in work steps of up to 60 bytes, then end with an empty end step that checks the CRC. Every step replies with VP2_ACK_OK or VP2_ACK_FAILED.