Module for managing the HID protocol state.
More...
Module for managing the HID protocol state.
Function for the value linked to the HID usage where value change is absolute.
- Parameters
-
[in] | usage | Usage to update. |
[in] | report | Value linked with the usage. |
- Note
- Absolute changes are used for events associated with keys and will be enqueued in case a connection is not established. For more information, look for usage types defined in HID Usage Tables.
Function for updating the value linked to the HID usage where value change is relative.
- Parameters
-
[in] | usage | Usage to update. |
[in] | report | Value linked with the usage. |
- Note
- Relative changes are used for events associated with motion and will not be enqueued in case a connection is not established. For more information, look for usage types defined in HID Usage Tables.
ret_code_t m_protocol_hid_state_connect |
( |
void |
| ) |
|
Function for switching the HID state to connected state.
- Returns
- NRF_SUCCESS on success, otherwise an error code.
ret_code_t m_protocol_hid_state_disconnect |
( |
void |
| ) |
|
Function for switching the HID state to disconnected state.
- Returns
- NRF_SUCCESS on success, otherwise an error code.
Function for getting the state of the given usage.
- Parameters
-
[in] | usage | HID usage to find. |
- Returns
- Protocol HID state item or NULL if not found.
ret_code_t m_protocol_hid_state_init |
( |
void |
| ) |
|
Function for initializing the states of all items.
- Returns
- NRF_SUCCESS on success, otherwise an error code.
Function for starting the iterator over a HID page.
- Parameters
-
- Returns
- First item with the given page or NULL if not found.
Function for moving the state iterator to the next item.
- Parameters
-
- Returns
- Next protocol HID item or NULL if not found.
void m_protocol_hid_state_update |
( |
uint32_t |
usage, |
|
|
int16_t |
report, |
|
|
bool |
absolute |
|
) |
| |
Function for updating the value linked to the HID usage.
The function updates the HID state and triggers a report generation event if BLE is connected. If a connection was not made yet, information about usage change may be stored in a queue if usage is queueable.
- Parameters
-
[in] | usage | Usage to update. |
[in] | report | Value linked with the usage. |
[in] | absolute | If true, this change event will be enqueued until a connection is established. |