nRF51 SDK
|
Human Interface Device Service module. More...
Typedefs | |
typedef struct ble_hids_s | ble_hids_t |
HID Service structure. This contains various status information for the service. | |
typedef void(* | ble_hids_evt_handler_t )(ble_hids_t *p_hids, ble_hids_evt_t *p_evt) |
HID Service event handler type. | |
Enumerations | |
enum | ble_hids_evt_type_t { BLE_HIDS_EVT_HOST_SUSP, BLE_HIDS_EVT_HOST_EXIT_SUSP, BLE_HIDS_EVT_NOTIF_ENABLED, BLE_HIDS_EVT_NOTIF_DISABLED, BLE_HIDS_EVT_REP_CHAR_WRITE, BLE_HIDS_EVT_BOOT_MODE_ENTERED, BLE_HIDS_EVT_REPORT_MODE_ENTERED } |
HID Service event type. More... | |
Functions | |
uint32_t | ble_hids_init (ble_hids_t *p_hids, const ble_hids_init_t *p_hids_init) |
Function for initializing the HID Service. More... | |
void | ble_hids_on_ble_evt (ble_hids_t *p_hids, ble_evt_t *p_ble_evt) |
Function for handling the Application's BLE Stack events. More... | |
uint32_t | ble_hids_inp_rep_send (ble_hids_t *p_hids, uint8_t rep_index, uint16_t len, uint8_t *p_data) |
Function for sending Input Report. More... | |
uint32_t | ble_hids_boot_kb_inp_rep_send (ble_hids_t *p_hids, uint16_t len, uint8_t *p_data) |
Function for sending Boot Keyboard Input Report. More... | |
uint32_t | ble_hids_boot_mouse_inp_rep_send (ble_hids_t *p_hids, uint8_t buttons, int8_t x_delta, int8_t y_delta, uint16_t optional_data_len, uint8_t *p_optional_data) |
Function for sending Boot Mouse Input Report. More... | |
uint32_t | ble_hids_outp_rep_get (ble_hids_t *p_hids, uint8_t rep_index, uint16_t len, uint8_t offset, uint8_t *p_outp_rep) |
Function for getting the current value of Output Report from the stack. More... | |
Data Structures | |
struct | ble_hids_char_id_t |
HID Service characteristic id. More... | |
struct | ble_hids_evt_t |
HID Service event. More... | |
struct | ble_hids_hid_information_t |
HID Information characteristic value. More... | |
struct | ble_hids_inp_rep_init_t |
HID Service Input Report characteristic init structure. This contains all options and data needed for initialization of one Input Report characteristic. More... | |
struct | ble_hids_outp_rep_init_t |
HID Service Output Report characteristic init structure. This contains all options and data needed for initialization of one Output Report characteristic. More... | |
struct | ble_hids_feature_rep_init_t |
HID Service Feature Report characteristic init structure. This contains all options and data needed for initialization of one Feature Report characteristic. More... | |
struct | ble_hids_rep_map_init_t |
HID Service Report Map characteristic init structure. This contains all options and data needed for initialization of the Report Map characteristic. More... | |
struct | ble_hids_rep_char_t |
HID Report characteristic structure. More... | |
struct | ble_hids_init_t |
HID Service init structure. This contains all options and data needed for initialization of the service. More... | |
struct | ble_hids_s |
HID Service structure. This contains various status information for the service. More... | |
This module implements the Human Interface Device Service with the corresponding set of characteristics. During initialization it adds the Human Interface Device Service and a set of characteristics as per the Human Interface Device Service specification and the user requirements to the BLE stack database.
If enabled, notification of Input Report characteristics is performed when the application calls the corresponding ble_hids_xx_input_report_send() function.
If an event handler is supplied by the application, the Human Interface Device Service will generate Human Interface Device Service events to the application.
enum ble_hids_evt_type_t |
uint32_t ble_hids_init | ( | ble_hids_t * | p_hids, |
const ble_hids_init_t * | p_hids_init | ||
) |
[out] | p_hids | HID Service structure. This structure will have to be supplied by the application. It will be initialized by this function, and will later be used to identify this particular service instance. |
[in] | p_hids_init | Information needed to initialize the service. |
void ble_hids_on_ble_evt | ( | ble_hids_t * | p_hids, |
ble_evt_t * | p_ble_evt | ||
) |
Handles all events from the BLE stack of interest to the HID Service.
[in] | p_hids | HID Service structure. |
[in] | p_ble_evt | Event received from the BLE stack. |
uint32_t ble_hids_inp_rep_send | ( | ble_hids_t * | p_hids, |
uint8_t | rep_index, | ||
uint16_t | len, | ||
uint8_t * | p_data | ||
) |
Sends data on an Input Report characteristic.
[in] | p_hids | HID Service structure. |
[in] | rep_index | Index of the characteristic (corresponding to the index in ble_hids_t.inp_rep_array as passed to ble_hids_init()). |
[in] | len | Length of data to be sent. |
[in] | p_data | Pointer to data to be sent. |
uint32_t ble_hids_boot_kb_inp_rep_send | ( | ble_hids_t * | p_hids, |
uint16_t | len, | ||
uint8_t * | p_data | ||
) |
Sends data on an Boot Keyboard Input Report characteristic.
[in] | p_hids | HID Service structure. |
[in] | len | Length of data to be sent. |
[in] | p_data | Pointer to data to be sent. |
uint32_t ble_hids_boot_mouse_inp_rep_send | ( | ble_hids_t * | p_hids, |
uint8_t | buttons, | ||
int8_t | x_delta, | ||
int8_t | y_delta, | ||
uint16_t | optional_data_len, | ||
uint8_t * | p_optional_data | ||
) |
Sends data on an Boot Mouse Input Report characteristic.
[in] | p_hids | HID Service structure. |
[in] | buttons | State of mouse buttons. |
[in] | x_delta | Horizontal movement. |
[in] | y_delta | Vertical movement. |
[in] | optional_data_len | Length of optional part of Boot Mouse Input Report. |
[in] | p_optional_data | Optional part of Boot Mouse Input Report. |
uint32_t ble_hids_outp_rep_get | ( | ble_hids_t * | p_hids, |
uint8_t | rep_index, | ||
uint16_t | len, | ||
uint8_t | offset, | ||
uint8_t * | p_outp_rep | ||
) |
Fetches the current value of the output report characteristic from the stack.
[in] | p_hids | HID Service structure. |
[in] | rep_index | Index of the characteristic (corresponding to the index in ble_hids_t.outp_rep_array as passed to ble_hids_init()). |
[in] | len | Length of output report needed. |
[in] | offset | Offset in bytes to read from. |
[out] | p_outp_rep | Pointer to the output report. |