Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Mar 29, 2024
1 parent 9c8e7bd commit 0ad25e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
18 changes: 13 additions & 5 deletions app/src/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct zmk_hid_ptp_feature_certification_report ptp_feature_certification_report
struct zmk_hid_ptp_feature_capabilities_report ptp_feature_capabilities_report = {
.report_id = ZMK_HID_REPORT_ID_FEATURE_PTP_CAPABILITIES,
.max_touches = CONFIG_ZMK_TRACKPAD_MAX_FINGERS,
.pad_type = PTP_PAD_TYPE_NON_CLICKABLE};
.pad_type = PTP_PAD_TYPE_DEPRESSIBLE};
#endif

// Keep track of how often a modifier was pressed.
Expand Down Expand Up @@ -503,18 +503,26 @@ void zmk_hid_ptp_set(struct zmk_ptp_finger finger, uint8_t contact_count, uint16
}
#endif

struct zmk_hid_keyboard_report *zmk_hid_get_keyboard_report(void) { return &keyboard_report; }
struct zmk_hid_keyboard_report *zmk_hid_get_keyboard_report(void) {
return &keyboard_report;
}

struct zmk_hid_consumer_report *zmk_hid_get_consumer_report(void) { return &consumer_report; }
struct zmk_hid_consumer_report *zmk_hid_get_consumer_report(void) {
return &consumer_report;
}

#if IS_ENABLED(CONFIG_ZMK_MOUSE)

struct zmk_hid_mouse_report *zmk_hid_get_mouse_report(void) { return &mouse_report; }
struct zmk_hid_mouse_report *zmk_hid_get_mouse_report(void) {
return &mouse_report;
}

#endif // IS_ENABLED(CONFIG_ZMK_MOUSE)

#if IS_ENABLED(CONFIG_ZMK_TRACKPAD)
struct zmk_hid_ptp_report *zmk_hid_get_ptp_report(void) { return &ptp_report; }
struct zmk_hid_ptp_report *zmk_hid_get_ptp_report(void) {
return &ptp_report;
}

struct zmk_hid_ptp_feature_selective_report *zmk_hid_ptp_get_feature_selective_report() {
return &ptp_feature_selective_report;
Expand Down
10 changes: 7 additions & 3 deletions app/src/hog.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct hids_report {
} __packed;

static struct hids_info info = {
.version = 0x0000,
.version = 0x1101,
.code = 0x00,
.flags = HIDS_NORMALLY_CONNECTABLE | HIDS_REMOTE_WAKE,
};
Expand Down Expand Up @@ -200,8 +200,12 @@ static ssize_t read_hids_trackpad_certification_feature_report(struct bt_conn *c
const struct bt_gatt_attr *attr,
void *buf, uint16_t len,
uint16_t offset) {
uint8_t *report_body = &zmk_hid_ptp_get_feature_certification_report()->ptphqa_blob;
return bt_gatt_attr_read(conn, attr, buf, len, offset, report_body, 256);
struct zmk_hid_ptp_feature_certification_report *report =
zmk_hid_ptp_get_feature_certification_report();
LOG_DBG("Get HQA at offset %d with len %d to fetch total size %d", offset, len,
sizeof(report->ptphqa_blob));
return bt_gatt_attr_read(conn, attr, buf, len, offset, &report->ptphqa_blob,
sizeof(report->ptphqa_blob));
}

static ssize_t write_hids_trackpad_mode_feature_report(struct bt_conn *conn,
Expand Down

0 comments on commit 0ad25e9

Please sign in to comment.