Nayel
Nayel
DIIDevHeads IoT Integration Server
Created by melta101 on 7/31/2024 in #middleware-and-os
How to convert relative cursor movement to absolute position for BLE HID using Zephyr?
struct hid_report {
uint8_t buttons;
uint16_t x;
uint16_t y;
} __packed;

static struct hid_report report = {0};

void set_cursor_position(uint16_t x, uint16_t y) {
report.x = x;
report.y = y;

// Send the updated report
bt_gatt_notify(NULL, &hid_svc.attrs[2], &report, sizeof(report));
}
struct hid_report {
uint8_t buttons;
uint16_t x;
uint16_t y;
} __packed;

static struct hid_report report = {0};

void set_cursor_position(uint16_t x, uint16_t y) {
report.x = x;
report.y = y;

// Send the updated report
bt_gatt_notify(NULL, &hid_svc.attrs[2], &report, sizeof(report));
}
15 replies