From e0b5070f49028a0dd571d997c2520391cd4c0a5c Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 14 Nov 2021 21:10:57 +1100 Subject: [PATCH] d/wmr: Rename controller related packets Rename the controller and bluetooth related packets according to their usage, and split out the controller update handling function. --- src/xrt/drivers/wmr/wmr_hmd.c | 17 ++++++++++++----- src/xrt/drivers/wmr/wmr_protocol.h | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/xrt/drivers/wmr/wmr_hmd.c b/src/xrt/drivers/wmr/wmr_hmd.c index df4775309..8d018acf2 100644 --- a/src/xrt/drivers/wmr/wmr_hmd.c +++ b/src/xrt/drivers/wmr/wmr_hmd.c @@ -76,7 +76,12 @@ hololens_unknown_17_decode_packet(struct wmr_hmd *wh, const unsigned char *buffe } static void -hololens_unknown_05_06_0E_decode_packet(struct wmr_hmd *wh, const unsigned char *buffer, int size) +hololens_handle_bt_iface_packet(struct wmr_hmd *wh, const unsigned char *buffer, int size) +{ +} + +static void +hololens_handle_controller_packet(struct wmr_hmd *wh, const unsigned char *buffer, int size) { if (size >= 45) { WMR_TRACE(wh, @@ -211,10 +216,12 @@ hololens_sensors_read_packets(struct wmr_hmd *wh) break; } - case WMR_MS_HOLOLENS_MSG_UNKNOWN_05: - case WMR_MS_HOLOLENS_MSG_UNKNOWN_06: - case WMR_MS_HOLOLENS_MSG_UNKNOWN_0E: // - hololens_unknown_05_06_0E_decode_packet(wh, buffer, size); + case WMR_MS_HOLOLENS_MSG_BT_IFACE: // + hololens_handle_bt_iface_packet(wh, buffer, size); + break; + case WMR_MS_HOLOLENS_MSG_LEFT_CONTROLLER: + case WMR_MS_HOLOLENS_MSG_RIGHT_CONTROLLER: // + hololens_handle_controller_packet(wh, buffer, size); break; case WMR_MS_HOLOLENS_MSG_UNKNOWN_17: // hololens_unknown_17_decode_packet(wh, buffer, size); diff --git a/src/xrt/drivers/wmr/wmr_protocol.h b/src/xrt/drivers/wmr/wmr_protocol.h index e526d9d4d..8de3902e0 100644 --- a/src/xrt/drivers/wmr/wmr_protocol.h +++ b/src/xrt/drivers/wmr/wmr_protocol.h @@ -34,9 +34,9 @@ extern "C" { #define WMR_MS_HOLOLENS_MSG_SENSORS 0x01 #define WMR_MS_HOLOLENS_MSG_CONTROL 0x02 // Integrated motion controller messages? #define WMR_MS_HOLOLENS_MSG_DEBUG 0x03 -#define WMR_MS_HOLOLENS_MSG_UNKNOWN_05 0x05 -#define WMR_MS_HOLOLENS_MSG_UNKNOWN_06 0x06 -#define WMR_MS_HOLOLENS_MSG_UNKNOWN_0E 0x0E +#define WMR_MS_HOLOLENS_MSG_BT_IFACE 0x05 /* Bluetooth interface */ +#define WMR_MS_HOLOLENS_MSG_LEFT_CONTROLLER 0x06 /* Left controller */ +#define WMR_MS_HOLOLENS_MSG_RIGHT_CONTROLLER 0x0E /* Right controller */ #define WMR_MS_HOLOLENS_MSG_UNKNOWN_17 0x17 // Messages types specific to WMR Hololens Sensors' companion devices