From 3ac1a11a370d262e54538f0e10d947303cf77afa Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Sat, 21 Nov 2020 20:09:21 +0000 Subject: refactor: change `keypad` to `keyboard` The application usage used by report 1 is `HID_USAGE_GD_KEYBOARD`. Moreover, the `keys` usage page (0x07) that primarily feeds into this report is predominantly keyboard codes. The rest of the system should align with this naming convention. --- app/src/hog.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/src/hog.c') diff --git a/app/src/hog.c b/app/src/hog.c index bcd652d..ea61933 100644 --- a/app/src/hog.c +++ b/app/src/hog.c @@ -79,9 +79,9 @@ static ssize_t read_hids_report_map(struct bt_conn *conn, const struct bt_gatt_a static ssize_t read_hids_input_report(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, u16_t len, u16_t offset) { - struct zmk_hid_keypad_report_body *report_body = &zmk_hid_get_keypad_report()->body; + struct zmk_hid_keyboard_report_body *report_body = &zmk_hid_get_keyboard_report()->body; return bt_gatt_attr_read(conn, attr, buf, len, offset, report_body, - sizeof(struct zmk_hid_keypad_report_body)); + sizeof(struct zmk_hid_keyboard_report_body)); } static ssize_t read_hids_consumer_input_report(struct bt_conn *conn, @@ -156,7 +156,7 @@ struct bt_conn *destination_connection() { return conn; } -int zmk_hog_send_keypad_report(struct zmk_hid_keypad_report_body *report) { +int zmk_hog_send_keyboard_report(struct zmk_hid_keyboard_report_body *report) { struct bt_conn *conn = destination_connection(); if (conn == NULL) { return -ENOTCONN; @@ -164,8 +164,8 @@ int zmk_hog_send_keypad_report(struct zmk_hid_keypad_report_body *report) { LOG_DBG("Sending to NULL? %s", conn == NULL ? "yes" : "no"); - int err = - bt_gatt_notify(conn, &hog_svc.attrs[5], report, sizeof(struct zmk_hid_keypad_report_body)); + int err = bt_gatt_notify(conn, &hog_svc.attrs[5], report, + sizeof(struct zmk_hid_keyboard_report_body)); bt_conn_unref(conn); return err; }; -- cgit v1.2.3