26#define MND_API_VERSION_MAJOR 1
28#define MND_API_VERSION_MINOR 4
30#define MND_API_VERSION_PATCH 0
39 MND_ERROR_INVALID_VERSION = -1,
40 MND_ERROR_INVALID_VALUE = -2,
41 MND_ERROR_CONNECTING_FAILED = -3,
42 MND_ERROR_OPERATION_FAILED = -4,
56 MND_CLIENT_PRIMARY_APP = (1u << 0u),
57 MND_CLIENT_SESSION_ACTIVE = (1u << 1u),
58 MND_CLIENT_SESSION_VISIBLE = (1u << 2u),
59 MND_CLIENT_SESSION_FOCUSED = (1u << 3u),
60 MND_CLIENT_SESSION_OVERLAY = (1u << 4u),
61 MND_CLIENT_IO_ACTIVE = (1u << 5u),
108 MND_SPACE_REFERENCE_TYPE_VIEW,
109 MND_SPACE_REFERENCE_TYPE_LOCAL,
110 MND_SPACE_REFERENCE_TYPE_LOCAL_FLOOR,
111 MND_SPACE_REFERENCE_TYPE_STAGE,
112 MND_SPACE_REFERENCE_TYPE_UNBOUNDED,
482 mnd_root_t *root, uint32_t device_index,
bool *out_present,
bool *out_charging,
float *out_charge);
mnd_result_t mnd_root_set_tracking_origin_offset(mnd_root_t *root, uint32_t origin_id, const mnd_pose_t *offset)
Apply an offset to the specified tracking origin.
Definition: monado.c:520
mnd_result_t mnd_root_create(mnd_root_t **out_root)
Create libmonado state and connect to service.
Definition: monado.c:124
mnd_result_t mnd_root_get_device_info_bool(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, bool *out_bool)
Get boolean property for the device at the given index.
Definition: monado.c:299
mnd_result_t mnd_root_get_device_info_string(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, const char **out_string)
Get string property for the device at the given index.
Definition: monado.c:374
mnd_result
Result codes for operations, negative are errors, zero or positives are success.
Definition: monado.h:37
@ MND_ERROR_INVALID_PROPERTY
Supported in version 1.2 and above.
Definition: monado.h:46
@ MND_ERROR_INVALID_OPERATION
Supported in version 1.3 and above.
Definition: monado.h:48
@ MND_ERROR_RECENTERING_NOT_SUPPORTED
Supported in version 1.1 and above.
Definition: monado.h:44
mnd_result_t mnd_root_get_tracking_origin_offset(mnd_root_t *root, uint32_t origin_id, mnd_pose_t *out_offset)
Read the current offset of a tracking origin.
Definition: monado.c:507
void mnd_api_get_version(uint32_t *out_major, uint32_t *out_minor, uint32_t *out_patch)
Returns the version of the API (not Monado itself), follows the versioning semantics of https://semve...
Definition: monado.c:109
enum mnd_result mnd_result_t
Result codes for operations, negative are errors, zero or positives are success.
mnd_result_t mnd_root_get_client_state(mnd_root_t *root, uint32_t client_id, uint32_t *out_flags)
Get the state flags of the client at the given index.
Definition: monado.c:219
mnd_result_t mnd_root_get_reference_space_offset(mnd_root_t *root, mnd_reference_space_type_t type, mnd_pose_t *out_offset)
Get the current offset value of the specified reference space.
Definition: monado.c:480
mnd_property
A property to get from a thing (currently only devices).
Definition: monado.h:70
@ MND_PROPERTY_SUPPORTS_POSITION_BOOL
Supported in version 1.4.0 and above.
Definition: monado.h:78
@ MND_PROPERTY_NAME_STRING
Supported in version 1.2 and above.
Definition: monado.h:72
@ MND_PROPERTY_SUPPORTS_ORIENTATION_BOOL
Supported in version 1.4.0 and above.
Definition: monado.h:80
@ MND_PROPERTY_TRACKING_ORIGIN_U32
Supported in version 1.4.0 and above.
Definition: monado.h:76
@ MND_PROPERTY_SERIAL_STRING
Supported in version 1.2 and above.
Definition: monado.h:74
void mnd_root_destroy(mnd_root_t **root_ptr)
Destroy libmonado state, disconnecting from the service, and zeroing the pointer.
Definition: monado.c:146
mnd_result_t mnd_root_get_client_name(mnd_root_t *root, uint32_t client_id, const char **out_name)
Get the name of the client at the given index.
Definition: monado.c:202
mnd_result_t mnd_root_get_device_battery_status(mnd_root_t *root, uint32_t device_index, bool *out_present, bool *out_charging, float *out_charge)
Get battery status of a device.
Definition: monado.c:562
mnd_result_t mnd_root_recenter_local_spaces(mnd_root_t *root)
Trigger a recenter of the local spaces.
Definition: monado.c:468
mnd_result_t mnd_root_get_device_from_role(mnd_root_t *root, const char *role_name, int32_t *out_index)
Get the device index associated for a given role name.
Definition: monado.c:415
struct mnd_pose mnd_pose_t
A pose composed of a position and orientation.
mnd_reference_space_type
Types of reference space.
Definition: monado.h:107
mnd_result_t mnd_root_get_device_info_i32(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, uint32_t *out_i32)
Get int32_t property for the device at the given index.
Definition: monado.c:321
mnd_result_t mnd_root_update_client_list(mnd_root_t *root)
Update our local cached copy of the client list.
Definition: monado.c:166
mnd_result_t mnd_root_set_reference_space_offset(mnd_root_t *root, mnd_reference_space_type_t type, const mnd_pose_t *offset)
Apply an offset to the specified reference space.
Definition: monado.c:493
mnd_result_t mnd_root_get_tracking_origin_name(mnd_root_t *root, uint32_t origin_id, const char **out_string)
Retrieve the name of the indicated tracking origin.
Definition: monado.c:544
mnd_result_t mnd_root_get_client_id_at_index(mnd_root_t *root, uint32_t index, uint32_t *out_client_id)
Get the id from the current client list.
Definition: monado.c:191
mnd_result_t mnd_root_set_client_focused(mnd_root_t *root, uint32_t client_id)
Set the client at the given index as "focused".
Definition: monado.c:258
enum mnd_client_flags mnd_client_flags_t
Bitflags for client application state.
mnd_result_t mnd_root_toggle_client_io_active(mnd_root_t *root, uint32_t client_id)
Toggle io activity for the client at the given index.
Definition: monado.c:273
enum mnd_reference_space_type mnd_reference_space_type_t
Types of reference space.
mnd_client_flags
Bitflags for client application state.
Definition: monado.h:55
mnd_result_t mnd_root_get_device_count(mnd_root_t *root, uint32_t *out_device_count)
Get the number of devices.
Definition: monado.c:288
mnd_result_t mnd_root_get_device_info(mnd_root_t *root, uint32_t device_index, uint32_t *out_device_id, const char **out_dev_name)
Get device info at the given index.
Definition: monado.c:396
mnd_result_t mnd_root_set_client_primary(mnd_root_t *root, uint32_t client_id)
Set the client at the given index as "primary".
Definition: monado.c:243
enum mnd_property mnd_property_t
A property to get from a thing (currently only devices).
mnd_result_t mnd_root_get_device_info_u32(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, uint32_t *out_u32)
Get uint32_t property for the device at the given index.
Definition: monado.c:337
mnd_result_t mnd_root_get_number_clients(mnd_root_t *root, uint32_t *out_num)
Get the number of active clients.
Definition: monado.c:180
mnd_result_t mnd_root_get_device_info_float(mnd_root_t *root, uint32_t device_index, mnd_property_t prop, float *out_float)
Get float property for the device at the given index.
Definition: monado.c:358
mnd_result_t mnd_root_get_tracking_origin_count(mnd_root_t *root, uint32_t *out_track_count)
Retrieve the number of tracking origins available.
Definition: monado.c:533
A pose composed of a position and orientation.
Definition: monado.h:92