Vive Controller prober and driver code.
More...
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xrt/xrt_prober.h"
#include "math/m_api.h"
#include "util/u_debug.h"
#include "util/u_device.h"
#include "util/u_json.h"
#include "util/u_misc.h"
#include "util/u_time.h"
#include "os/os_hid.h"
#include "os/os_threading.h"
#include "os/os_time.h"
#include "../vive/vive_protocol.h"
#include "vive_controller_interface.h"
#include "math/m_imu_3dof.h"
◆ DEFAULT_HAPTIC_FREQ
#define DEFAULT_HAPTIC_FREQ 150.0f |
◆ FEATURE_BUFFER_SIZE
#define FEATURE_BUFFER_SIZE 256 |
◆ MIN_HAPTIC_DURATION
#define MIN_HAPTIC_DURATION 0.05f |
◆ SET_INDEX_INPUT
#define SET_INDEX_INPUT |
( |
|
NAME, |
|
|
|
NAME2 |
|
) |
| |
Value:do { \
(d->base.inputs[VIVE_CONTROLLER_INDEX_##NAME].name = \
XRT_INPUT_INDEX_##NAME2); \
} while (0)
◆ SET_WAND_INPUT
#define SET_WAND_INPUT |
( |
|
NAME, |
|
|
|
NAME2 |
|
) |
| |
Value:do { \
(d->base.inputs[VIVE_CONTROLLER_INDEX_##NAME].name = \
XRT_INPUT_VIVE_##NAME2); \
} while (0)
◆ VIVE_CLOCK_FREQ
#define VIVE_CLOCK_FREQ 48000000.0f |
◆ VIVE_CONTROLLER_DEBUG
#define VIVE_CONTROLLER_DEBUG |
( |
|
p, |
|
|
|
... |
|
) |
| |
Value:do { \
if (p->print_debug) { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} \
} while (false)
Referenced by vive_controller_found().
◆ VIVE_CONTROLLER_ERROR
#define VIVE_CONTROLLER_ERROR |
( |
|
p, |
|
|
|
... |
|
) |
| |
Value:do { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} while (false)
Referenced by vive_controller_found().
◆ VIVE_CONTROLLER_SPEW
#define VIVE_CONTROLLER_SPEW |
( |
|
p, |
|
|
|
... |
|
) |
| |
Value:do { \
if (p->print_spew) { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} \
} while (false)
◆ controller_variant
Enumerator |
---|
CONTROLLER_VIVE_WAND | |
CONTROLLER_INDEX_LEFT | |
CONTROLLER_INDEX_RIGHT | |
CONTROLLER_UNKNOWN | |
◆ watchman_gen
Enumerator |
---|
WATCHMAN_GEN1 | |
WATCHMAN_GEN2 | |
WATCHMAN_GEN_UNKNOWN | |
◆ DEBUG_GET_ONCE_BOOL_OPTION()
DEBUG_GET_ONCE_BOOL_OPTION |
( |
vive_controller_spew |
, |
|
|
"VIVE_CONTROLLER_PRINT_SPEW" |
, |
|
|
false |
|
|
) |
| |