d/vive: Parse/Recognize HTC Vive Pro Eye HMD headphone audio buttons.

Does not do anything yet within Monado, but documents how to parse
button state of left headphone volume up/down buttons and right
headphone microphone mute button.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
This commit is contained in:
Mario Kleiner 2023-04-13 22:29:28 +02:00 committed by Jakob Bornecrantz
parent 0116a76db5
commit 9e647f9a46
3 changed files with 10 additions and 1 deletions

View file

@ -288,10 +288,17 @@ vive_mainboard_decode_message(struct vive_device *d, struct vive_mainboard_statu
d->board.proximity = proximity;
}
/* System button on HMD */
if (d->board.button != report->button) {
d->board.button = report->button;
VIVE_TRACE(d, "Button %d.", report->button);
}
/* Vive Pro headphone buttons, reported mutually exclusive: 1 = Volume up, 2 = Volume down, 4 = Mic mute */
if (d->board.audio_button != report->audio_button) {
d->board.audio_button = report->audio_button;
VIVE_TRACE(d, "Audio button %d.", report->audio_button);
}
}
static inline int

View file

@ -56,6 +56,7 @@ struct vive_device
uint16_t lens_separation;
uint16_t proximity;
uint8_t button;
uint8_t audio_button;
} board;
enum u_logging_level log_level;

View file

@ -87,7 +87,8 @@ struct vive_mainboard_status_report
uint16_t lens_separation;
uint16_t reserved1;
uint8_t button;
uint8_t reserved2[3];
uint8_t audio_button;
uint8_t reserved2[2];
uint8_t proximity_change;
uint8_t reserved3;
uint16_t proximity;