Wallbot_CaaS
Dependencies: MPU6050 mbed PID
Fork of BLE_MPU6050_test6_challenge_sb by
Human Interface Device Service
Human Interface Device Service module. 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. More... | |
struct | ble_hids_outp_rep_init_t |
HID Service Output Report characteristic init structure. More... | |
struct | ble_hids_feature_rep_init_t |
HID Service Feature Report characteristic init structure. More... | |
struct | ble_hids_rep_map_init_t |
HID Service Report Map characteristic init structure. More... | |
struct | ble_hids_rep_char_t |
HID Report characteristic structure. More... | |
struct | ble_hids_init_t |
HID Service init structure. More... | |
struct | ble_hids_s |
HID Service structure. More... | |
Typedefs | |
typedef struct ble_hids_s | ble_hids_t |
HID Service structure. | |
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, BLE_HIDS_EVT_REPORT_READ } |
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. | |
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. | |
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. | |
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. | |
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. | |
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. |
Detailed Description
Human Interface Device Service module.
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.
- Note:
- The application must propagate BLE stack events to the Human Interface Device Service module by calling ble_hids_on_ble_evt() from the ble_stack_handler callback.
- Attention! To maintain compliance with Nordic Semiconductor ASA Bluetooth profile qualification listings, this section of source code must not be modified.
Typedef Documentation
typedef void(* ble_hids_evt_handler_t)(ble_hids_t *p_hids, ble_hids_evt_t *p_evt) |
HID Service event handler type.
Definition at line 111 of file ble_hids.h.
typedef struct ble_hids_s ble_hids_t |
HID Service structure.
This contains various status information for the service.
Definition at line 108 of file ble_hids.h.
Enumeration Type Documentation
enum ble_hids_evt_type_t |
HID Service event type.
- Enumerator:
Definition at line 70 of file ble_hids.h.
Function Documentation
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.
Sends data on an Boot Keyboard Input Report characteristic.
- Parameters:
-
[in] p_hids HID Service structure. [in] len Length of data to be sent. [in] p_data Pointer to data to be sent.
- Returns:
- NRF_SUCCESS on successful sending of the report, otherwise an error code.
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.
Sends data on an Boot Mouse Input Report characteristic.
- Parameters:
-
[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.
- Returns:
- NRF_SUCCESS on successful sending of the report, otherwise an error code.
uint32_t ble_hids_init | ( | ble_hids_t * | p_hids, |
const ble_hids_init_t * | p_hids_init | ||
) |
Function for initializing the HID Service.
- Parameters:
-
[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.
- Returns:
- NRF_SUCCESS on successful initialization of service, otherwise an error code.
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.
Sends data on an Input Report characteristic.
- Parameters:
-
[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.
- Returns:
- NRF_SUCCESS on successful sending of input report, otherwise an error code.
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.
Handles all events from the BLE stack of interest to the HID Service.
- Parameters:
-
[in] p_hids HID Service structure. [in] p_ble_evt Event received from the BLE stack.
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.
Fetches the current value of the output report characteristic from the stack.
- Parameters:
-
[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.
- Returns:
- NRF_SUCCESS on successful read of the report, otherwise an error code.
Generated on Tue Jul 12 2022 18:33:10 by 1.7.2