Skip to content
Snippets Groups Projects
Commit 0a5c478b authored by schneider's avatar schneider
Browse files

fix(hid): Don't crash when not enabled

parent 577d6b15
No related branches found
No related tags found
1 merge request!382HID over BLE
...@@ -214,6 +214,10 @@ int epic_ble_hid_send_report(uint8_t report_id, uint8_t *data, uint8_t len) ...@@ -214,6 +214,10 @@ int epic_ble_hid_send_report(uint8_t report_id, uint8_t *data, uint8_t len)
return -EIO; return -EIO;
} }
if (!queue) {
return -EIO;
}
int ret; int ret;
ret = hid_queue_data(report_id, data, len); ret = hid_queue_data(report_id, data, len);
......
...@@ -2332,7 +2332,7 @@ API(API_BLE_GET_SCAN_REPORT, int epic_ble_get_scan_report(struct epic_scan_repor ...@@ -2332,7 +2332,7 @@ API(API_BLE_GET_SCAN_REPORT, int epic_ble_get_scan_report(struct epic_scan_repor
* :return: `0` on success, `1` if the report is queued or a negative value if an error occured. Possible * :return: `0` on success, `1` if the report is queued or a negative value if an error occured. Possible
* errors: * errors:
* *
* - ``-EIO``: There is no host device connected * - ``-EIO``: There is no host device connected or BLE HID is not enabled.
* - ``-EAGAIN``: There is no space in the queue available. Try again later. * - ``-EAGAIN``: There is no space in the queue available. Try again later.
* - ``-EINVAL``: Either the report_id is out of range or the data is too long. * - ``-EINVAL``: Either the report_id is out of range or the data is too long.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment