#include "hids_device.h"
#include "ble/att_db.h"
#include "ble/att_server.h"
#include "bluetooth_gatt.h"
#include "btstack_util.h"
#include "btstack_debug.h"
Macros | |
#define | __BTSTACK_FILE__ "hids_device.c" |
Functions | |
static uint16_t | att_read_callback (hci_con_handle_t connection_handle, uint16_t att_handle, uint16_t offset, uint8_t *buffer, uint16_t buffer_size) |
static int | att_write_callback (hci_con_handle_t con_handle, uint16_t att_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size) |
static void | hids_device_can_send_now (void *context) |
static void | hids_device_emit_event_with_uint8 (uint8_t event, hci_con_handle_t con_handle, uint8_t value) |
void | hids_device_init (uint8_t country_code, const uint8_t *descriptor, uint16_t descriptor_size) |
Set up HIDS Device. More... | |
void | hids_device_register_packet_handler (btstack_packet_handler_t callback) |
Register callback for the HIDS Device client. More... | |
void | hids_device_request_can_send_now_event (hci_con_handle_t con_handle) |
Request can send now event to send HID Report Generates an HIDS_SUBEVENT_CAN_SEND_NOW subevent. More... | |
void | hids_device_send_boot_keyboard_input_report (hci_con_handle_t con_handle, const uint8_t *report, uint16_t report_len) |
Send HID Boot Mouse Input Report. More... | |
void | hids_device_send_boot_mouse_input_report (hci_con_handle_t con_handle, const uint8_t *report, uint16_t report_len) |
Send HID Boot Mouse Input Report. More... | |
void | hids_device_send_input_report (hci_con_handle_t con_handle, const uint8_t *report, uint16_t report_len) |
Send HID Report: Input. More... | |
#define __BTSTACK_FILE__ "hids_device.c" |
|
static |
References att_read_callback_handle_blob(), att_read_callback_handle_byte(), att_read_callback_handle_little_endian_16(), hid_boot_keyboard_input_client_configuration_handle, hid_boot_keyboard_input_client_configuration_value, hid_boot_mouse_input_client_configuration_handle, hid_descriptor, hid_descriptor_size, hid_protocol_mode, hid_protocol_mode_value_handle, hid_report_input_client_configuration_handle, hid_report_input_client_configuration_value, hid_report_map_handle, log_info, and UNUSED.
Referenced by hids_device_init().
|
static |
References hid_boot_keyboard_input_client_configuration_handle, hid_boot_keyboard_input_client_configuration_value, hid_boot_mouse_input_client_configuration_handle, hid_boot_mouse_input_client_configuration_value, hid_protocol_mode, hid_protocol_mode_value_handle, hid_report_input_client_configuration_handle, hid_report_input_client_configuration_value, hids_device_emit_event_with_uint8(), HIDS_SUBEVENT_BOOT_KEYBOARD_INPUT_REPORT_ENABLE, HIDS_SUBEVENT_BOOT_MOUSE_INPUT_REPORT_ENABLE, HIDS_SUBEVENT_INPUT_REPORT_ENABLE, HIDS_SUBEVENT_PROTOCOL_MODE, little_endian_read_16(), log_info, and UNUSED.
Referenced by hids_device_init().
|
static |
References buffer, con_handle, HCI_EVENT_HIDS_META, HCI_EVENT_PACKET, HIDS_SUBEVENT_CAN_SEND_NOW, little_endian_store_16(), and packet_handler.
Referenced by hids_device_request_can_send_now_event().
|
static |
References buffer, HCI_EVENT_HIDS_META, HCI_EVENT_PACKET, little_endian_store_16(), and packet_handler.
Referenced by att_write_callback().
void hids_device_init | ( | uint8_t | country_code, |
const uint8_t * | descriptor, | ||
uint16_t | descriptor_size | ||
) |
Set up HIDS Device.
Implementation of the GATT HIDS Device To use with your application, add '#import <hids.gatt>' to your .gatt file.
References att_read_callback(), att_register_service_handler(), att_write_callback(), att_service_handler::end_handle, gatt_server_get_client_configuration_handle_for_characteristic_with_uuid16(), gatt_server_get_get_handle_range_for_service_with_uuid16(), gatt_server_get_value_handle_for_characteristic_with_uuid16(), hid_boot_keyboard_input_client_configuration_handle, hid_boot_keyboard_input_value_handle, hid_boot_mouse_input_client_configuration_handle, hid_boot_mouse_input_value_handle, hid_country_code, hid_descriptor, hid_descriptor_size, hid_protocol_mode, hid_protocol_mode_value_handle, hid_report_input_client_configuration_handle, hid_report_input_value_handle, hid_report_map_handle, ORG_BLUETOOTH_CHARACTERISTIC_BOOT_KEYBOARD_INPUT_REPORT, ORG_BLUETOOTH_CHARACTERISTIC_BOOT_MOUSE_INPUT_REPORT, ORG_BLUETOOTH_CHARACTERISTIC_PROTOCOL_MODE, ORG_BLUETOOTH_CHARACTERISTIC_REPORT, ORG_BLUETOOTH_CHARACTERISTIC_REPORT_MAP, ORG_BLUETOOTH_SERVICE_HUMAN_INTERFACE_DEVICE, att_service_handler::read_callback, att_service_handler::start_handle, and att_service_handler::write_callback.
void hids_device_register_packet_handler | ( | btstack_packet_handler_t | callback | ) |
Register callback for the HIDS Device client.
callback |
References callback, and packet_handler.
void hids_device_request_can_send_now_event | ( | hci_con_handle_t | con_handle | ) |
Request can send now event to send HID Report Generates an HIDS_SUBEVENT_CAN_SEND_NOW subevent.
hid_cid |
References att_server_register_can_send_now_callback(), btstack_context_callback_registration_t::callback, con_handle, btstack_context_callback_registration_t::context, and hids_device_can_send_now().
void hids_device_send_boot_keyboard_input_report | ( | hci_con_handle_t | con_handle, |
const uint8_t * | report, | ||
uint16_t | report_len | ||
) |
Send HID Boot Mouse Input Report.
References att_server_notify(), and hid_boot_keyboard_input_value_handle.
void hids_device_send_boot_mouse_input_report | ( | hci_con_handle_t | con_handle, |
const uint8_t * | report, | ||
uint16_t | report_len | ||
) |
Send HID Boot Mouse Input Report.
References att_server_notify(), and hid_boot_mouse_input_value_handle.
void hids_device_send_input_report | ( | hci_con_handle_t | con_handle, |
const uint8_t * | report, | ||
uint16_t | report_len | ||
) |
Send HID Report: Input.
References att_server_notify(), and hid_report_input_value_handle.
|
static |
|
static |
Referenced by att_read_callback(), att_write_callback(), and hids_device_init().
|
static |
Referenced by att_read_callback(), and att_write_callback().
|
static |
Referenced by hids_device_init(), and hids_device_send_boot_keyboard_input_report().
|
static |
Referenced by att_read_callback(), att_write_callback(), and hids_device_init().
|
static |
Referenced by att_write_callback().
|
static |
Referenced by hids_device_init(), and hids_device_send_boot_mouse_input_report().
|
static |
Referenced by hids_device_init().
|
static |
Referenced by att_read_callback(), and hids_device_init().
|
static |
Referenced by att_read_callback(), and hids_device_init().
|
static |
Referenced by att_read_callback(), att_write_callback(), and hids_device_init().
|
static |
Referenced by att_read_callback(), att_write_callback(), and hids_device_init().
|
static |
Referenced by att_read_callback(), att_write_callback(), and hids_device_init().
|
static |
Referenced by att_read_callback(), and att_write_callback().
|
static |
Referenced by hids_device_init(), and hids_device_send_input_report().
|
static |
Referenced by att_read_callback(), and hids_device_init().
|
static |
|
static |
Implementation of the GATT HIDS Device To use with your application, add '#import <hids.gatt>' to your .gatt file.
Referenced by att_dispatch_register_client(), att_dispatch_register_server(), gatt_client_listen_for_characteristic_value_updates(), hids_device_can_send_now(), hids_device_emit_event_with_uint8(), hids_device_register_packet_handler(), and l2cap_emit_can_send_now().