From 0ad25e9eb46e36decf6f049ca33703bf83b951f5 Mon Sep 17 00:00:00 2001 From: ReFil <31960031+ReFil@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:58:29 +0000 Subject: [PATCH] changes --- app/src/hid.c | 18 +++++++++++++----- app/src/hog.c | 10 +++++++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/src/hid.c b/app/src/hid.c index 58bac23a68c..21b2407a01a 100644 --- a/app/src/hid.c +++ b/app/src/hid.c @@ -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. @@ -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; diff --git a/app/src/hog.c b/app/src/hog.c index bcf05da2f86..561916060aa 100644 --- a/app/src/hog.c +++ b/app/src/hog.c @@ -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, }; @@ -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,