d/arduino: Add device bindings

This commit is contained in:
Jakob Bornecrantz 2020-11-03 19:04:40 +00:00
parent 7c807a8605
commit 5997708634

View file

@ -368,6 +368,30 @@ arduino_device_get_tracked_pose(struct xrt_device *xdev,
}
/*
*
* Bindings
*
*/
static struct xrt_binding_input_pair simple_inputs[4] = {
{XRT_INPUT_SIMPLE_SELECT_CLICK, XRT_INPUT_DAYDREAM_BAR_CLICK},
{XRT_INPUT_SIMPLE_MENU_CLICK, XRT_INPUT_DAYDREAM_CIRCLE_CLICK},
{XRT_INPUT_SIMPLE_GRIP_POSE, XRT_INPUT_DAYDREAM_POSE},
{XRT_INPUT_SIMPLE_AIM_POSE, XRT_INPUT_DAYDREAM_POSE},
};
static struct xrt_binding_profile binding_profiles[1] = {
{
.name = XRT_DEVICE_SIMPLE_CONTROLLER,
.inputs = simple_inputs,
.num_inputs = ARRAY_SIZE(simple_inputs),
.outputs = NULL,
.num_outputs = 0,
},
};
/*
*
* Prober functions.
@ -395,6 +419,8 @@ arduino_device_create(struct os_ble_device *ble,
ad->base.inputs[4].name = XRT_INPUT_DAYDREAM_VOLDN_CLICK;
ad->base.inputs[5].name = XRT_INPUT_DAYDREAM_VOLUP_CLICK;
ad->base.inputs[6].name = XRT_INPUT_DAYDREAM_TOUCHPAD;
ad->base.binding_profiles = binding_profiles;
ad->base.num_binding_profiles = ARRAY_SIZE(binding_profiles);
ad->ble = ble;
ad->print_spew = print_spew;