The open source OpenXR runtime
0
fork

Configure Feed

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

ipc: add battery status query

Co-authored-by: Gabriele Musco <gabmus@disroot.org>
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2292>

authored by

Torge Matthies
Gabriele Musco
and committed by
Marge Bot
f5b9ed31 81d9d1ee

+23
+1
doc/changes/ipc/mr.2292.md
··· 1 + all: Add device battery status query.
+1
src/xrt/ipc/client/ipc_client_hmd.c
··· 377 377 ich->base.force_feedback_supported = isdev->force_feedback_supported; 378 378 ich->base.form_factor_check_supported = isdev->form_factor_check_supported; 379 379 ich->base.stage_supported = isdev->stage_supported; 380 + ich->base.battery_status_supported = isdev->battery_status_supported; 380 381 381 382 return &ich->base; 382 383 }
+8
src/xrt/ipc/server/ipc_server_handler.c
··· 2140 2140 struct xrt_device *xdev = get_xdev(ics, id); 2141 2141 return xrt_device_get_body_joints(xdev, body_tracking_type, desired_timestamp_ns, out_value); 2142 2142 } 2143 + 2144 + xrt_result_t 2145 + ipc_handle_device_get_battery_status( 2146 + volatile struct ipc_client_state *ics, uint32_t id, bool *out_present, bool *out_charging, float *out_charge) 2147 + { 2148 + struct xrt_device *xdev = get_xdev(ics, id); 2149 + return xrt_device_get_battery_status(xdev, out_present, out_charging, out_charge); 2150 + }
+1
src/xrt/ipc/server/ipc_server_process.c
··· 356 356 isdev->face_tracking_supported = xdev->face_tracking_supported; 357 357 isdev->body_tracking_supported = xdev->body_tracking_supported; 358 358 isdev->stage_supported = xdev->stage_supported; 359 + isdev->battery_status_supported = xdev->battery_status_supported; 359 360 360 361 // Is this a HMD? 361 362 if (xdev->hmd != NULL) {
+1
src/xrt/ipc/shared/ipc_protocol.h
··· 137 137 bool force_feedback_supported; 138 138 bool form_factor_check_supported; 139 139 bool stage_supported; 140 + bool battery_status_supported; 140 141 }; 141 142 142 143 /*!
+11
src/xrt/ipc/shared/proto.json
··· 512 512 "out": [ 513 513 {"name": "value", "type": "struct xrt_body_joint_set"} 514 514 ] 515 + }, 516 + 517 + "device_get_battery_status": { 518 + "in": [ 519 + {"name": "id", "type": "uint32_t"} 520 + ], 521 + "out": [ 522 + {"name": "present", "type": "bool"}, 523 + {"name": "charging", "type": "bool"}, 524 + {"name": "charge", "type": "float"} 525 + ] 515 526 } 516 527 517 528 }