|
SmartSnippets DA1459x SDK
|
Human Interface Device Service Client. More...
Files | |
| file | hids_client.h |
| HID Service Client header file. | |
Data Structures | |
| struct | hids_client_hid_info_t |
| HID Service Client info data. More... | |
Functions | |
| ble_client_t * | hids_client_init (const hids_client_config_t *config, const hids_client_callbacks_t *cb, const ble_evt_gattc_browse_svc_t *evt) |
| Register HID Client instance. More... | |
| ble_client_t * | hids_client_init_from_data (uint16_t conn_idx, const hids_client_config_t *config, const hids_client_callbacks_t *cb, const void *data, size_t length) |
| Initialize and register HID Client instance from data buffer. More... | |
| bool | hids_client_set_protocol_mode (ble_client_t *client) |
| Set protocol mode. More... | |
| bool | hids_client_boot_report_read (ble_client_t *client, hids_client_boot_report_type type) |
| Read Boot Report. More... | |
| bool | hids_client_boot_report_write (ble_client_t *client, hids_client_boot_report_type type, bool response, uint16_t length, const uint8_t *data) |
| Write Boot Report. More... | |
| bool | hids_client_report_write (ble_client_t *client, hids_client_report_type_t type, uint8_t report_id, bool response, uint16_t length, const uint8_t *data) |
| Write Report. More... | |
| bool | hids_client_report_read (ble_client_t *client, hids_client_report_type_t type, uint8_t report_id) |
| Read Report. More... | |
| bool | hids_client_cp_command (ble_client_t *client, hids_client_cp_command_t command) |
| Write command to control point. More... | |
| bool | hids_client_input_report_set_notif_state (ble_client_t *client, uint8_t report_id, bool enable) |
| Enable/disable notifications for Input Report. More... | |
| bool | hids_client_input_report_get_notif_state (ble_client_t *client, uint8_t report_id) |
| Check if notifications are enabled for Input Report. More... | |
| bool | hids_client_boot_report_set_notif_state (ble_client_t *client, hids_client_boot_report_type type, bool enable) |
| Enable/disable notifications for Boot Input reports. More... | |
| bool | hids_client_boot_report_get_notif_state (ble_client_t *client, hids_client_boot_report_type type) |
| Check if notifications are enabled for Boot Input Report. More... | |
| bool | hids_client_get_protocol_mode (ble_client_t *client) |
| Get protocol mode. More... | |
| bool | hids_client_read_hid_info (ble_client_t *client) |
| Get HID Info characteristic. More... | |
| bool | hids_client_read_report_map (ble_client_t *client) |
| Read Report Map characteristic. More... | |
| bool | hids_client_discover_external_reports (ble_client_t *client) |
| Read External Reports descriptors. More... | |
| bool | hids_client_discover_reports (ble_client_t *client) |
| Read Report Reference descriptors. More... | |
| hids_client_cap_t | hids_client_get_capabilities (ble_client_t *client) |
| Get capabilities. More... | |
| void | hids_client_dump_dervice_data (ble_client_t *client, hids_client_dump_service_data_cb_t cb) |
| Dump HID Service data. More... | |
Human Interface Device Service Client.
| enum hids_client_cap_t |
HIDS Client capabilities.
| bool hids_client_boot_report_get_notif_state | ( | ble_client_t * | client, |
| hids_client_boot_report_type | type | ||
| ) |
Check if notifications are enabled for Boot Input Report.
Function triggers read request to CCC descriptor of given report.
| [in] | client | hids_client instance |
| [in] | type | boot report type |
| bool hids_client_boot_report_read | ( | ble_client_t * | client, |
| hids_client_boot_report_type | type | ||
| ) |
Read Boot Report.
Function triggers read operation of Boot Report Characteristic. Read response will be returned in boot_report callback.
| [in] | client | client |
| [in] | type | Type of boot report |
| bool hids_client_boot_report_set_notif_state | ( | ble_client_t * | client, |
| hids_client_boot_report_type | type, | ||
| bool | enable | ||
| ) |
Enable/disable notifications for Boot Input reports.
Function triggers write request to CCC descriptor of given report and registers or unregisters for notifications.
| [in] | client | hids_client instance |
| [in] | type | boot report type |
| [in] | enable | indicates if notifications shall be enabled/disabled |
| bool hids_client_boot_report_write | ( | ble_client_t * | client, |
| hids_client_boot_report_type | type, | ||
| bool | response, | ||
| uint16_t | length, | ||
| const uint8_t * | data | ||
| ) |
Write Boot Report.
Function triggers write operation of Boot Report Characteristic.
| [in] | client | client |
| [in] | type | type of boot report |
| [in] | response | require response - valid only for HIDS_CLIENT_BOOT_KEYBOARD_OUTPUT argument will be ignored in other cases |
| [in] | length | report length |
| [in] | data | report data |
| bool hids_client_cp_command | ( | ble_client_t * | client, |
| hids_client_cp_command_t | command | ||
| ) |
Write command to control point.
Function triggers write operation to Control Point characteristic.
| [in] | client | client |
| [in] | command | control point command |
| bool hids_client_discover_external_reports | ( | ble_client_t * | client | ) |
Read External Reports descriptors.
Function triggers read request to External Report Reference Descriptors. If service supports External Report References, external_report_found will be invoked. Once all read requests are completed, discover_external_reports_complete callback is called. This function should ba called right after init in HIDS_CLIENT_PROTOCOL_MODE_REPORT mode.
| [in] | client | hids_client instance |
| bool hids_client_discover_reports | ( | ble_client_t * | client | ) |
Read Report Reference descriptors.
Function triggers read requests to Report Reference descriptors. Callback report_found will be called for each read_response. Once all read requests are completed, discover_reports_completed callback is called. It should be called in HIDS_CLIENT_PROTOCOL_MODE_REPORT right after init.
| [in] | client | hids_client instance |
| void hids_client_dump_dervice_data | ( | ble_client_t * | client, |
| hids_client_dump_service_data_cb_t | cb | ||
| ) |
Dump HID Service data.
This function is used to print data about remote service details.
| [in] | client | hids_client instance |
| [in] | cb | dump service data callback |
| hids_client_cap_t hids_client_get_capabilities | ( | ble_client_t * | client | ) |
Get capabilities.
Function returns bitmask with supported characteristics. Note that Report characteristics won't be returned in this function as there might be multiple reports supported.
| client | hids_client instance |
| bool hids_client_get_protocol_mode | ( | ble_client_t * | client | ) |
Get protocol mode.
Function triggers read request to protocol mode characteristic. Callback get_protocol_mode will be invoked once finished.
| [in] | client | hids_client instance |
| ble_client_t* hids_client_init | ( | const hids_client_config_t * | config, |
| const hids_client_callbacks_t * | cb, | ||
| const ble_evt_gattc_browse_svc_t * | evt | ||
| ) |
Register HID Client instance.
Function registers HID Client
| [in] | config | HIDS client config |
| [in] | cb | application callbacks |
| [in] | evt | browse svc event with HID svc details |
| ble_client_t* hids_client_init_from_data | ( | uint16_t | conn_idx, |
| const hids_client_config_t * | config, | ||
| const hids_client_callbacks_t * | cb, | ||
| const void * | data, | ||
| size_t | length | ||
| ) |
Initialize and register HID Client instance from data buffer.
Function initializes HID Client from data buffer.
| [in] | conn_idx | connection index |
| [in] | config | HIDS client config |
| [in] | cb | application callbacks |
| [in] | data | data buffer |
| [in] | length | data buffer's length |
| bool hids_client_input_report_get_notif_state | ( | ble_client_t * | client, |
| uint8_t | report_id | ||
| ) |
Check if notifications are enabled for Input Report.
Function triggers read request to CCC descriptor of given report.
| [in] | client | hids_client instance |
| [in] | report_id | input report ID |
| bool hids_client_input_report_set_notif_state | ( | ble_client_t * | client, |
| uint8_t | report_id, | ||
| bool | enable | ||
| ) |
Enable/disable notifications for Input Report.
Function triggers write request to CCC descriptor of given report and registers or unregisters for notifications.
| [in] | client | hids_client instance |
| [in] | report_id | input report ID |
| [in] | enable | indicates if notifications shall be enabled/disabled |
| bool hids_client_read_hid_info | ( | ble_client_t * | client | ) |
Get HID Info characteristic.
Function triggers read request to HID Info characteristic. Callback hid_info_cb will be invoked once finished. It should be called after init in HIDS_CLIENT_PROTOCOL_MODE_REPORT mode.
| [in] | client | hids_client instance |
| bool hids_client_read_report_map | ( | ble_client_t * | client | ) |
Read Report Map characteristic.
Function triggers read request to Report Map characteristic. Callback report_map_cb will be invoked once finished. It should be called in HIDS_CLIENT_PROTOCOL_MODE_REPORT after init.
| [in] | client | hids_client instance |
| bool hids_client_report_read | ( | ble_client_t * | client, |
| hids_client_report_type_t | type, | ||
| uint8_t | report_id | ||
| ) |
Read Report.
Function triggers read operation of Report Characteristic. Read response will be returned in report callback.
| [in] | client | client |
| [in] | type | type of report |
| [in] | report_id | report ID |
| bool hids_client_report_write | ( | ble_client_t * | client, |
| hids_client_report_type_t | type, | ||
| uint8_t | report_id, | ||
| bool | response, | ||
| uint16_t | length, | ||
| const uint8_t * | data | ||
| ) |
Write Report.
Function triggers write operation of Report Characteristic.
| [in] | client | client |
| [in] | type | type of boot report |
| [in] | report_id | report ID |
| [in] | response | require response - valid only for HIDS_CLIENT_REPORT_TYPE_OUTPUT argument will be ignored in other cases |
| [in] | length | report length |
| [in] | data | report data |
| bool hids_client_set_protocol_mode | ( | ble_client_t * | client | ) |
Set protocol mode.
Function triggers write command to protocol mode characteristic with protocol mode defined in hids_config structure. Callback set_protocol_mode will be called once operation completed.
| [in] | client | client |
1.8.16