Smart Remote 3 nRF52 v1.2
Data Structures | Macros | Functions

Module for managing the HID protocol state. More...

Data Structures

struct  m_protocol_hid_state_item_t
 Protocol HID state item. More...
 

Macros

#define m_protocol_hid_state_update_abs(usage, report)   m_protocol_hid_state_update(usage, report, true)
 Function for the value linked to the HID usage where value change is absolute. More...
 
#define m_protocol_hid_state_update_rel(usage, report)   m_protocol_hid_state_update(usage, report, false)
 Function for updating the value linked to the HID usage where value change is relative. More...
 

Functions

ret_code_t m_protocol_hid_state_connect (void)
 Function for switching the HID state to connected state. More...
 
ret_code_t m_protocol_hid_state_disconnect (void)
 Function for switching the HID state to disconnected state. More...
 
m_protocol_hid_state_item_tm_protocol_hid_state_get (uint32_t usage)
 Function for getting the state of the given usage. More...
 
ret_code_t m_protocol_hid_state_init (void)
 Function for initializing the states of all items. More...
 
m_protocol_hid_state_item_t const * m_protocol_hid_state_page_it_init (uint16_t page)
 Function for starting the iterator over a HID page. More...
 
m_protocol_hid_state_item_t const * m_protocol_hid_state_page_it_next (m_protocol_hid_state_item_t const *p_item)
 Function for moving the state iterator to the next item. More...
 
void m_protocol_hid_state_update (uint32_t usage, int16_t report, bool absolute)
 Function for updating the value linked to the HID usage. More...
 

Detailed Description

Module for managing the HID protocol state.

Macro Definition Documentation

#define m_protocol_hid_state_update_abs (   usage,
  report 
)    m_protocol_hid_state_update(usage, report, true)

Function for the value linked to the HID usage where value change is absolute.

Parameters
[in]usageUsage to update.
[in]reportValue 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.
#define m_protocol_hid_state_update_rel (   usage,
  report 
)    m_protocol_hid_state_update(usage, report, false)

Function for updating the value linked to the HID usage where value change is relative.

Parameters
[in]usageUsage to update.
[in]reportValue 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.

Function Documentation

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.
m_protocol_hid_state_item_t* m_protocol_hid_state_get ( uint32_t  usage)

Function for getting the state of the given usage.

Parameters
[in]usageHID 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.
m_protocol_hid_state_item_t const* m_protocol_hid_state_page_it_init ( uint16_t  page)

Function for starting the iterator over a HID page.

Parameters
[in]pagePage to iterate.
Returns
First item with the given page or NULL if not found.
m_protocol_hid_state_item_t const* m_protocol_hid_state_page_it_next ( m_protocol_hid_state_item_t const *  p_item)

Function for moving the state iterator to the next item.

Parameters
[in]p_itemCurrent item.
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]usageUsage to update.
[in]reportValue linked with the usage.
[in]absoluteIf true, this change event will be enqueued until a connection is established.

Documentation feedback | Developer Zone | Subscribe | Updated