Microchip® Advanced Software Framework

hids_device.c File Reference
#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...
 

Variables

static
btstack_context_callback_registration_t 
battery_callback
 
static uint16_t hid_boot_keyboard_input_client_configuration_handle
 
static uint16_t hid_boot_keyboard_input_client_configuration_value
 
static uint16_t hid_boot_keyboard_input_value_handle
 
static uint16_t hid_boot_mouse_input_client_configuration_handle
 
static uint16_t hid_boot_mouse_input_client_configuration_value
 
static uint16_t hid_boot_mouse_input_value_handle
 
static uint8_t hid_country_code
 
static const uint8_t * hid_descriptor
 
static uint16_t hid_descriptor_size
 
static uint16_t hid_protocol_mode
 
static uint16_t hid_protocol_mode_value_handle
 
static uint16_t hid_report_input_client_configuration_handle
 
static uint16_t hid_report_input_client_configuration_value
 
static uint16_t hid_report_input_value_handle
 
static uint16_t hid_report_map_handle
 
static att_service_handler_t hid_service
 
static btstack_packet_handler_t packet_handler
 Implementation of the GATT HIDS Device To use with your application, add '#import <hids.gatt>' to your .gatt file. More...
 

#define __BTSTACK_FILE__   "hids_device.c"

static void hids_device_can_send_now ( void *  context)
static
static void hids_device_emit_event_with_uint8 ( uint8_t  event,
hci_con_handle_t  con_handle,
uint8_t  value 
)
static
void hids_device_register_packet_handler ( btstack_packet_handler_t  callback)

Register callback for the HIDS Device client.

Parameters
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.

Parameters
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.

btstack_context_callback_registration_t battery_callback
static
uint16_t hid_boot_keyboard_input_client_configuration_handle
static
uint16_t hid_boot_keyboard_input_client_configuration_value
static
uint16_t hid_boot_keyboard_input_value_handle
static
uint16_t hid_boot_mouse_input_client_configuration_handle
static
uint16_t hid_boot_mouse_input_client_configuration_value
static

Referenced by att_write_callback().

uint16_t hid_boot_mouse_input_value_handle
static
uint8_t hid_country_code
static

Referenced by hids_device_init().

const uint8_t* hid_descriptor
static
uint16_t hid_descriptor_size
static
uint16_t hid_protocol_mode
static
uint16_t hid_protocol_mode_value_handle
static
uint16_t hid_report_input_client_configuration_handle
static
uint16_t hid_report_input_client_configuration_value
static
uint16_t hid_report_input_value_handle
static
uint16_t hid_report_map_handle
static
att_service_handler_t hid_service
static