Monado OpenXR Runtime
ipc_client_android.h
Go to the documentation of this file.
1// Copyright 2020, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Header exposing Android-specific IPC client code to C.
6 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
7 * @ingroup ipc_android
8 */
9
10#pragma once
11
12#include <xrt/xrt_config_os.h>
13
14#ifdef XRT_OS_ANDROID
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20struct _JavaVM;
21
22/**
23 * @brief Opaque structure owning the client side of an Android IPC connection.
24 *
25 */
27
28/**
29 * @brief Create an ipc_client_android object.
30 *
31 * Uses org.freedesktop.monado.ipc.Client
32 *
33 * @param vm Java VM pointer
34 * @param activity An android.app.Activity jobject, cast to `void *`.
35 *
36 * @return struct ipc_client_android*
37 *
38 * @public @memberof ipc_client_android
39 */
40struct ipc_client_android *
41ipc_client_android_create(struct _JavaVM *vm, void *activity);
42
43/**
44 * @brief Make a blocking call to connect to an IPC server and establish socket
45 * connection.
46 *
47 * @param ica
48 * @return int file descriptor: -1 in case of error. Do not close it!
49 *
50 * @public @memberof ipc_client_android
51 */
52int
53ipc_client_android_blocking_connect(struct ipc_client_android *ica);
54
55
56/**
57 * @brief Destroy an ipc_client_android object.
58 *
59 * @param ptr_ica
60 *
61 * @public @memberof ipc_client_android
62 */
63void
64ipc_client_android_destroy(struct ipc_client_android **ptr_ica);
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif // XRT_OS_ANDROID
Definition: ipc_client_android.cpp:27
Auto detect OS and certain features.