hid_host.h (3eaa38a78ae298fe5818e4c09e8200c3094e541d) hid_host.h (14618ebfef9875b25a069464851370b09f5b07fa)
1/*
2 * Copyright (C) 2020 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 102 unchanged lines hidden (view full) ---

111 uint8_t hid_descriptor_status; // ERROR_CODE_SUCCESS if descriptor available,
112 // ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE if not, and
113 // ERROR_CODE_MEMORY_CAPACITY_EXCEEDED if descriptor is larger then the available space
114
115 uint8_t user_request_can_send_now;
116
117 // get report
118 hid_report_type_t report_type;
1/*
2 * Copyright (C) 2020 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 102 unchanged lines hidden (view full) ---

111 uint8_t hid_descriptor_status; // ERROR_CODE_SUCCESS if descriptor available,
112 // ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE if not, and
113 // ERROR_CODE_MEMORY_CAPACITY_EXCEEDED if descriptor is larger then the available space
114
115 uint8_t user_request_can_send_now;
116
117 // get report
118 hid_report_type_t report_type;
119 uint8_t report_id;
119 uint16_t report_id;
120
121 // control message, bit mask:
122 // SUSSPEND 1
123 // EXIT_SUSSPEND 2
124 // VIRTUAL_CABLE_UNPLUG 4
125 uint8_t control_tasks;
126
127 // set report

--- 98 unchanged lines hidden (view full) ---

226 * @result status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER, ERROR_CODE_COMMAND_DISALLOWED
227 */
228uint8_t hid_host_send_get_protocol(uint16_t hid_cid);
229
230/**
231 * @brief Send report to a Bluetooth HID Device and emit HID_SUBEVENT_SET_REPORT_RESPONSE with handshake_status, see hid_handshake_param_type_t. The Bluetooth HID Host shall send complete reports.
232 * @param hid_cid
233 * @param report_type see hid_report_type_t in btstack_hid.h
120
121 // control message, bit mask:
122 // SUSSPEND 1
123 // EXIT_SUSSPEND 2
124 // VIRTUAL_CABLE_UNPLUG 4
125 uint8_t control_tasks;
126
127 // set report

--- 98 unchanged lines hidden (view full) ---

226 * @result status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER, ERROR_CODE_COMMAND_DISALLOWED
227 */
228uint8_t hid_host_send_get_protocol(uint16_t hid_cid);
229
230/**
231 * @brief Send report to a Bluetooth HID Device and emit HID_SUBEVENT_SET_REPORT_RESPONSE with handshake_status, see hid_handshake_param_type_t. The Bluetooth HID Host shall send complete reports.
232 * @param hid_cid
233 * @param report_type see hid_report_type_t in btstack_hid.h
234 * @param report_id
234 * @param report_id or HID_REPORT_ID_UNDEFINED
235 * @param report
236 * @param report_len
237 * @result status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER, ERROR_CODE_COMMAND_DISALLOWED
238 */
235 * @param report
236 * @param report_len
237 * @result status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER, ERROR_CODE_COMMAND_DISALLOWED
238 */
239uint8_t hid_host_send_set_report(uint16_t hid_cid, hid_report_type_t report_type, uint8_t report_id, const uint8_t * report, uint8_t report_len);
239uint8_t hid_host_send_set_report(uint16_t hid_cid, hid_report_type_t report_type, uint16_t report_id, const uint8_t * report, uint8_t report_len);
240
241/**
242 * @brief Request a HID report from the Bluetooth HID Device and emit HID_SUBEVENT_GET_REPORT_RESPONSE event with with handshake_status, see hid_handshake_param_type_t.
243 * Polling Bluetooth HID Devices using the GET_REPORT transfer is costly in terms of time and overhead,
244 * and should be avoided whenever possible. The GET_REPORT transfer is typically only used by applications
245 * to determine the initial state of a Bluetooth HID Device. If the state of a report changes frequently,
246 * then the report should be reported over the more efficient Interrupt channel, see hid_host_send_report.
247 * @param hid_cid
248 * @param report_type see hid_report_type_t in btstack_hid.h
240
241/**
242 * @brief Request a HID report from the Bluetooth HID Device and emit HID_SUBEVENT_GET_REPORT_RESPONSE event with with handshake_status, see hid_handshake_param_type_t.
243 * Polling Bluetooth HID Devices using the GET_REPORT transfer is costly in terms of time and overhead,
244 * and should be avoided whenever possible. The GET_REPORT transfer is typically only used by applications
245 * to determine the initial state of a Bluetooth HID Device. If the state of a report changes frequently,
246 * then the report should be reported over the more efficient Interrupt channel, see hid_host_send_report.
247 * @param hid_cid
248 * @param report_type see hid_report_type_t in btstack_hid.h
249 * @param report_id
249 * @param report_id or HID_REPORT_ID_UNDEFINED
250 * @result status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER, ERROR_CODE_COMMAND_DISALLOWED
251 */
250 * @result status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER, ERROR_CODE_COMMAND_DISALLOWED
251 */
252uint8_t hid_host_send_get_report(uint16_t hid_cid, hid_report_type_t report_type, uint8_t report_id);
252uint8_t hid_host_send_get_report(uint16_t hid_cid, hid_report_type_t report_type, uint16_t report_id);
253
254/**
255 * @brief Send HID output report on interrupt channel.
256 * @param hid_cid
253
254/**
255 * @brief Send HID output report on interrupt channel.
256 * @param hid_cid
257 * @param report_id
257 * @param report_id or HID_REPORT_ID_UNDEFINED
258 * @param report
259 * @param report_len
260 * @result status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER, ERROR_CODE_COMMAND_DISALLOWED
261 */
258 * @param report
259 * @param report_len
260 * @result status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER, ERROR_CODE_COMMAND_DISALLOWED
261 */
262uint8_t hid_host_send_report(uint16_t hid_cid, uint8_t report_id, const uint8_t * report, uint8_t report_len);
262uint8_t hid_host_send_report(uint16_t hid_cid, uint16_t report_id, const uint8_t * report, uint8_t report_len);
263
264/**
265 * @brief Get descriptor data
266 * @param hid_cid
267 * @result data
268 */
269const uint8_t * hid_descriptor_storage_get_descriptor_data(uint16_t hid_cid);
270

--- 20 unchanged lines hidden ---
263
264/**
265 * @brief Get descriptor data
266 * @param hid_cid
267 * @result data
268 */
269const uint8_t * hid_descriptor_storage_get_descriptor_data(uint16_t hid_cid);
270

--- 20 unchanged lines hidden ---