diff --git a/src/xrt/targets/libmonado/monado.c b/src/xrt/targets/libmonado/monado.c index b2a2d01d9..5d87735d6 100644 --- a/src/xrt/targets/libmonado/monado.c +++ b/src/xrt/targets/libmonado/monado.c @@ -306,9 +306,15 @@ mnd_root_get_device_info_bool(mnd_root_t *root, uint32_t device_index, mnd_prope return MND_ERROR_INVALID_VALUE; } - PE("Is not a valid boolean property (%u)", prop); + const struct ipc_shared_device *shared_device = &root->ipc_c.ism->isdevs[device_index]; - return MND_ERROR_INVALID_PROPERTY; + switch (prop) { + case MND_PROPERTY_SUPPORTS_POSITION_BOOL: *out_bool = shared_device->position_tracking_supported; break; + case MND_PROPERTY_SUPPORTS_ORIENTATION_BOOL: *out_bool = shared_device->orientation_tracking_supported; break; + default: PE("Is not a valid boolean property (%u)", prop); return MND_ERROR_INVALID_PROPERTY; + } + + return MND_SUCCESS; } mnd_result_t @@ -338,9 +344,14 @@ mnd_root_get_device_info_u32(mnd_root_t *root, uint32_t device_index, mnd_proper return MND_ERROR_INVALID_VALUE; } - PE("Is not a valid u32 property (%u)", prop); + const struct ipc_shared_device *shared_device = &root->ipc_c.ism->isdevs[device_index]; - return MND_ERROR_INVALID_PROPERTY; + switch (prop) { + case MND_PROPERTY_TRACKING_ORIGIN_U32: *out_u32 = shared_device->tracking_origin_index; break; + default: PE("Is not a valid u32 property (%u)", prop); return MND_ERROR_INVALID_PROPERTY; + } + + return MND_SUCCESS; } mnd_result_t diff --git a/src/xrt/targets/libmonado/monado.h b/src/xrt/targets/libmonado/monado.h index 68897302f..4863549af 100644 --- a/src/xrt/targets/libmonado/monado.h +++ b/src/xrt/targets/libmonado/monado.h @@ -25,7 +25,7 @@ extern "C" { //! Major version of the API. #define MND_API_VERSION_MAJOR 1 //! Minor version of the API. -#define MND_API_VERSION_MINOR 3 +#define MND_API_VERSION_MINOR 4 //! Patch version of the API. #define MND_API_VERSION_PATCH 0 @@ -72,6 +72,12 @@ typedef enum mnd_property MND_PROPERTY_NAME_STRING = 0, //! Supported in version 1.2 and above. MND_PROPERTY_SERIAL_STRING = 1, + //! Supported in version 1.4.0 and above. + MND_PROPERTY_TRACKING_ORIGIN_U32 = 2, + //! Supported in version 1.4.0 and above. + MND_PROPERTY_SUPPORTS_POSITION_BOOL = 3, + //! Supported in version 1.4.0 and above. + MND_PROPERTY_SUPPORTS_ORIENTATION_BOOL = 4, } mnd_property_t; /*!