ipc: Transfer xdev serial over ipc

This commit is contained in:
Christoph Haag 2021-10-05 14:28:59 +02:00 committed by Jakob Bornecrantz
parent 28dc5747e2
commit 6a01170b23
4 changed files with 6 additions and 0 deletions

View file

@ -166,6 +166,7 @@ ipc_client_device_create(struct ipc_connection *ipc_c, struct xrt_tracking_origi
// Print name.
snprintf(icd->base.str, XRT_DEVICE_NAME_LEN, "%s", isdev->str);
snprintf(icd->base.serial, XRT_DEVICE_NAME_LEN, "%s", isdev->serial);
// Setup inputs, by pointing directly to the shared memory.
assert(isdev->input_count > 0);

View file

@ -199,6 +199,7 @@ ipc_client_hmd_create(struct ipc_connection *ipc_c, struct xrt_tracking_origin *
// Print name.
snprintf(ich->base.str, XRT_DEVICE_NAME_LEN, "%s", isdev->str);
snprintf(ich->base.serial, XRT_DEVICE_NAME_LEN, "%s", isdev->serial);
// Setup inputs, by pointing directly to the shared memory.
assert(isdev->input_count > 0);

View file

@ -272,6 +272,7 @@ init_shm(struct ipc_server *s)
isdev->name = xdev->name;
memcpy(isdev->str, xdev->str, sizeof(isdev->str));
memcpy(isdev->serial, xdev->serial, sizeof(isdev->serial));
isdev->orientation_tracking_supported = xdev->orientation_tracking_supported;
isdev->position_tracking_supported = xdev->position_tracking_supported;

View file

@ -106,6 +106,9 @@ struct ipc_shared_device
//! A string describing the device.
char str[XRT_DEVICE_NAME_LEN];
//! A unique identifier. Persistent across configurations, if possible.
char serial[XRT_DEVICE_NAME_LEN];
//! Number of bindings.
uint32_t binding_profile_count;
//! 'Offset' into the array of bindings where the bindings starts.