diff options
author | innovaker <66737976+innovaker@users.noreply.github.com> | 2020-11-21 20:09:21 +0000 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-11-21 15:52:16 -0500 |
commit | 3ac1a11a370d262e54538f0e10d947303cf77afa (patch) | |
tree | d698e9fbdd916c65a28cd8858a8ff063c813f4de /app/src/hog.c | |
parent | 3ebd192411c347ad0bf4859a63206efb6b730c29 (diff) |
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.
Diffstat (limited to 'app/src/hog.c')
-rw-r--r-- | app/src/hog.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; }; |