The open source OpenXR runtime
0
fork

Configure Feed

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

d/wmr: Parse and log HMD debug messages

authored by

Jan Schmidt and committed by
Jakob Bornecrantz
a14d6f1c 6bb29724

+24 -1
+24 -1
src/xrt/drivers/wmr/wmr_hmd.c
··· 92 92 } 93 93 94 94 static void 95 + hololens_decode_debug(struct wmr_hmd *wh, const unsigned char *buffer, int size) 96 + { 97 + if (size < 12) { 98 + WMR_TRACE(wh, "Got short debug packet (%i) 0x%02x", size, buffer[0]); 99 + return; 100 + } 101 + buffer += 1; 102 + 103 + uint32_t magic = read32(&buffer); 104 + if (magic != WMR_MAGIC) { 105 + WMR_TRACE(wh, "Debug packet (%i) 0x%02x had strange magic 0x%08x", size, buffer[0], magic); 106 + return; 107 + } 108 + uint32_t timestamp = read32(&buffer); 109 + uint16_t seq = read16(&buffer); 110 + uint8_t src_tag = read8(&buffer); 111 + int msg_len = size - 12; 112 + 113 + WMR_DEBUG(wh, "HMD debug: TS %f seq %u src %d: %.*s", timestamp / 1000.0, seq, src_tag, msg_len, buffer); 114 + } 115 + 116 + static void 95 117 hololens_sensors_decode_packet(struct wmr_hmd *wh, 96 118 struct hololens_sensors_packet *pkt, 97 119 const unsigned char *buffer, ··· 197 219 case WMR_MS_HOLOLENS_MSG_UNKNOWN_17: // 198 220 hololens_unknown_17_decode_packet(wh, buffer, size); 199 221 break; 200 - case WMR_MS_HOLOLENS_MSG_CONTROL: 222 + case WMR_MS_HOLOLENS_MSG_CONTROL: // 201 223 WMR_DEBUG(wh, "WMR_MS_HOLOLENS_MSG_CONTROL: %02x, (%i)", buffer[0], size); 202 224 break; 203 225 case WMR_MS_HOLOLENS_MSG_DEBUG: // 226 + hololens_decode_debug(wh, buffer, size); 204 227 break; 205 228 default: // 206 229 WMR_DEBUG(wh, "Unknown message type: %02x, (%i)", buffer[0], size);