Monado OpenXR Runtime
Loading...
Searching...
No Matches

Small cli application to control IPC service. More...

#include "util/u_file.h"
#include "client/ipc_client.h"
#include "client/ipc_client_connection.h"
#include "ipc_client_generated.h"
#include "xrt/xrt_results.h"
#include <getopt.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for main.c:

Data Structures

struct  full_device_info
 

Macros

#define P(...)   fprintf(stdout, __VA_ARGS__)
 
#define PE(...)   fprintf(stderr, __VA_ARGS__)
 

Typedefs

typedef enum op_mode op_mode_t
 

Enumerations

enum  op_mode {
  MODE_GET , MODE_SET_PRIMARY , MODE_SET_FOCUSED , MODE_TOGGLE_IO ,
  MODE_RECENTER , MODE_GET_BRIGHTNESS , MODE_SET_BRIGHTNESS
}
 
enum  LongOptions { OPTION_DEVICE = 1 , OPTION_GET_BRIGHTNESS , OPTION_SET_BRIGHTNESS }
 

Functions

static xrt_result_t get_device_list (struct ipc_connection *ipc_c, struct full_device_info *out_full)
 Get the device list from a given connection.
 
int get_mode (struct ipc_connection *ipc_c)
 
int set_primary (struct ipc_connection *ipc_c, int client_id)
 
int set_focused (struct ipc_connection *ipc_c, int client_id)
 
int toggle_io (struct ipc_connection *ipc_c, int client_id)
 
int recenter_local_spaces (struct ipc_connection *ipc_c)
 
int get_first_device_id (struct ipc_connection *ipc_c)
 
int get_brightness (struct ipc_connection *ipc_c, int device_id)
 
int set_brightness (struct ipc_connection *ipc_c, int device_id, const char *value)
 
int main (int argc, char *argv[])
 

Detailed Description

Small cli application to control IPC service.

Author
Pete Black pblac.nosp@m.k@co.nosp@m.llabo.nosp@m.ra.c.nosp@m.om

Function Documentation

◆ get_device_list()

static xrt_result_t get_device_list ( struct ipc_connection ipc_c,
struct full_device_info out_full 
)
static

Get the device list from a given connection.

Parameters
ipc_cThe IPC connection.
[out]out_fullThe full device info struct to fill out.
Returns
XRT_SUCCESS on success, or an error code.

References ipc_device_list::device_count, ipc_device_list::devices, ipc_device_list_entry::id, and XRT_SUCCESS.