Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
HIDD Library API

HIDD Functions. More...

Functions

void wiced_hidd_app_init (wiced_bt_device_type_t dev_type)
 Does the necessary initialization for HID Device. More...
 
void wiced_hidd_register_callback_for_poll_event (wiced_bt_transport_t transport_type, BD_ADDR peer_bdaddr, wiced_bool_t enabled, void(*callback)(void *, uint32_t))
 Register with the controller with callback function, which will be called just before the poll event from the central if enabled. More...
 
void wiced_hidd_event_queue_init (wiced_hidd_app_event_queue_t *theq, void *bufStart_c, uint8_t elementSize_c, uint8_t maxNumElements_c)
 Constructor for the circular queue. More...
 
void wiced_hidd_event_queue_flush (wiced_hidd_app_event_queue_t *theq)
 Discards all elements in the queue, including any elements in the overflow slot. More...
 
uint8_t wiced_hidd_event_queue_get_num_elements (wiced_hidd_app_event_queue_t *theq)
 Gets the number of elements currently in the queue. More...
 
void * wiced_hidd_event_queue_get_current_element (wiced_hidd_app_event_queue_t *theq)
 Returns pointer to the first element in the queue. More...
 
void wiced_hidd_event_queue_remove_current_element (wiced_hidd_app_event_queue_t *theq)
 Removes the current element from the queue. More...
 
void wiced_hidd_event_queue_add_event_with_overflow (wiced_hidd_app_event_queue_t *theq, HidEvent *event, uint8_t len, uint8_t pollSeqn)
 Queue the given event into the event fifo. More...
 
uint32_t wiced_hidd_get_current_native_bt_clock (void)
 Get the current native Bluetooth clock This counter is 28 bits, and ticks every 312.5 us and is adjusted for drift through sleep, etc. More...
 
uint32_t wiced_hidd_get_bt_clocks_since (uint32_t before)
 Compute the time elapsed since "before", in Bluetooth clocks. More...
 
wiced_bool_t wiced_hidd_is_transport_detection_polling_on (void)
 Check if transport (UART, USB etc.) detection polling is still on-going. More...
 
wiced_bool_t wiced_hidd_is_transport_detected (void)
 Check if transport (UART, USB etc.) is detected. More...
 
wiced_bool_t wiced_blehidd_is_link_encrypted (void)
 Check if the current LE connection is encrypted. More...
 
void wiced_blehidd_set_link_encrypted_flag (wiced_bool_t is_encrypted)
 set the encrypted flag for the current LE connection we ask application to set the flag, so that it will be saved in always on (AON) memory when entering shutdown sleep (SDS) and restored when exiting SDS More...
 
wiced_bool_t wiced_blehidd_is_device_bonded (void)
 Check if the current LE connected device is bonded with us. More...
 
void wiced_blehidd_set_device_bonded_flag (wiced_bool_t is_bonded)
 set the bonded flag for the current LE connected device. More...
 
uint8_t * wiced_blehidd_get_peer_addr (void)
 Get the peer (current LE connected) device BD Address. More...
 
uint8_t wiced_blehidd_get_peer_addr_type (void)
 Get the peer (current LE connected) device address Type. More...
 
uint16_t wiced_blehidd_get_connection_interval (void)
 Get Connection Interval. More...
 
uint16_t wiced_blehidd_get_peripheral_latency (void)
 Get Connection Peripheral Latency. More...
 
uint16_t wiced_blehidd_get_supervision_timeout (void)
 Get Supervision Timeout. More...
 
uint16_t wiced_blehidd_get_connection_handle (void)
 Get Connection Handle, which is returned by controller in the LE connection complete event. More...
 
void wiced_blehidd_register_report_table (wiced_blehidd_report_gatt_characteristic_t *table, uint32_t num)
 register HID report table for sending and receiving More...
 
wiced_bt_gatt_status_t wiced_blehidd_send_report (uint16_t gatts_conn_id, uint8_t reportID, wiced_hidd_report_type_t reportType, uint8_t *data, uint8_t length)
 send HID report as GATT notification More...
 
wiced_bt_gatt_status_t wiced_blehidd_write_handler (void *data)
 Handle GATT write cmd/req for HID reports. More...
 
uint16_t wiced_blehidd_get_att_mtu_size (BD_ADDR bda)
 
void wiced_blehidd_allow_peripheral_latency (wiced_bool_t allow)
 Allow applications to disable peripheral latency. More...
 
void wiced_blehidd_set_asym_peripheral_latency (uint16_t connHandle, uint16_t latency)
 Allow applications to set asymmetric peripheral latency in peripheral side. More...
 
wiced_bool_t wiced_blehidd_is_wakeup_from_conn_req (void)
 Check if wake up from ShutDown Sleep is due to receiving LE connect request. More...
 
void wiced_bthidd_setDefaultLinkSupervisionTimeout (UINT16 slots)
 set the default Link Supervision Timeout value More...
 

Detailed Description

HIDD Functions.

Function Documentation

void wiced_blehidd_allow_peripheral_latency ( wiced_bool_t  allow)

Allow applications to disable peripheral latency.

Audio and gestural work best when peripheral latency is disabled.

Parameters
allow- WICED_TRUE (allow peripheral latency) or WICED_FALSE (disable peripheral latency)
Returns
none
uint16_t wiced_blehidd_get_att_mtu_size ( BD_ADDR  bda)
Parameters
bda- peer device BD Address
Returns
ATT_MTU size
uint16_t wiced_blehidd_get_connection_handle ( void  )

Get Connection Handle, which is returned by controller in the LE connection complete event.

Parameters
none
Returns
current connection handle
uint16_t wiced_blehidd_get_connection_interval ( void  )

Get Connection Interval.

Parameters
none
Returns
current connection interval
uint8_t* wiced_blehidd_get_peer_addr ( void  )

Get the peer (current LE connected) device BD Address.

Parameters
none
Returns
BD Address
uint8_t wiced_blehidd_get_peer_addr_type ( void  )

Get the peer (current LE connected) device address Type.

Parameters
none
Returns
none
uint16_t wiced_blehidd_get_peripheral_latency ( void  )

Get Connection Peripheral Latency.

Parameters
none
Returns
current connection peripheral latency
uint16_t wiced_blehidd_get_supervision_timeout ( void  )

Get Supervision Timeout.

Parameters
none
Returns
current Supervision Timeout
wiced_bool_t wiced_blehidd_is_device_bonded ( void  )

Check if the current LE connected device is bonded with us.

Parameters
none
Returns
WICED_TRUE - bonded WICED_FALSE -not bonded
wiced_bool_t wiced_blehidd_is_link_encrypted ( void  )

Check if the current LE connection is encrypted.

Parameters
none
Returns
WICED_TRUE - encrypted WICED_FALSE -not encrypted
wiced_bool_t wiced_blehidd_is_wakeup_from_conn_req ( void  )

Check if wake up from ShutDown Sleep is due to receiving LE connect request.

Parameters
none
Returns
WICED_TRUE/WICED_FALSE
void wiced_blehidd_register_report_table ( wiced_blehidd_report_gatt_characteristic_t table,
uint32_t  num 
)

register HID report table for sending and receiving

Parameters
map- point to HID report table
num- number of items in the HID report table
wiced_bt_gatt_status_t wiced_blehidd_send_report ( uint16_t  gatts_conn_id,
uint8_t  reportID,
wiced_hidd_report_type_t  reportType,
uint8_t *  data,
uint8_t  length 
)

send HID report as GATT notification

Parameters
gatts_conn_id- GATT connection ID
reportID- report ID
reportType- report type.
data- pointer to report data
length- length of the report data
Returns
0 - successful others - failed
void wiced_blehidd_set_asym_peripheral_latency ( uint16_t  connHandle,
uint16_t  latency 
)

Allow applications to set asymmetric peripheral latency in peripheral side.

when central doesn't accept peripheral's connection parameter update request, peripheral can enable asymmetric peripheral latency to lower power consumption

Parameters
connHandle- connection handle
latency- peripheral latency
Returns
none
void wiced_blehidd_set_device_bonded_flag ( wiced_bool_t  is_bonded)

set the bonded flag for the current LE connected device.

Application needs to call this function when successful pairing is competed and after each successful reconnection. we ask application to set the flag, so that it will be saved in always on (AON) memory when entering shutdown sleep (SDS) and restored when exiting SDS

Parameters
is_bonded- WICED_TRUE/WICED_FALSE
Returns
none
void wiced_blehidd_set_link_encrypted_flag ( wiced_bool_t  is_encrypted)

set the encrypted flag for the current LE connection we ask application to set the flag, so that it will be saved in always on (AON) memory when entering shutdown sleep (SDS) and restored when exiting SDS

Parameters
is_encrypted- WICED_TRUE/WICED_FALSE
Returns
none
wiced_bt_gatt_status_t wiced_blehidd_write_handler ( void *  data)

Handle GATT write cmd/req for HID reports.

Parameters
data- pointer point to GATT attribute
Returns
0 - successful others - failed
void wiced_bthidd_setDefaultLinkSupervisionTimeout ( UINT16  slots)

set the default Link Supervision Timeout value

Parameters
slots- New supervision timeout value in slots (625us)
void wiced_hidd_app_init ( wiced_bt_device_type_t  dev_type)

Does the necessary initialization for HID Device.

Parameters
dev_type- BT_DEVICE_TYPE_BREDR or BT_DEVICE_TYPE_BLE or BT_DEVICE_TYPE_BREDR_BLE
Returns
none.
void wiced_hidd_event_queue_add_event_with_overflow ( wiced_hidd_app_event_queue_t theq,
HidEvent *  event,
uint8_t  len,
uint8_t  pollSeqn 
)

Queue the given event into the event fifo.

If the event fifo is full, it queues an overflow event.

Parameters
theq- pointer to the circular queue
event- pointer to event to queue
len-length of event
pollSeqn-the poll SEQN
Returns
none
void wiced_hidd_event_queue_flush ( wiced_hidd_app_event_queue_t theq)

Discards all elements in the queue, including any elements in the overflow slot.

Parameters
none
Returns
none
void* wiced_hidd_event_queue_get_current_element ( wiced_hidd_app_event_queue_t theq)

Returns pointer to the first element in the queue.

If the queue is empty, returns NULL.

Parameters
theq- pointer to the circular queue
Returns
pointer to the next element in the queue if the queue is not empty NULL if the queue is empty
uint8_t wiced_hidd_event_queue_get_num_elements ( wiced_hidd_app_event_queue_t theq)

Gets the number of elements currently in the queue.

Parameters
theq- pointer to the circular queue
Returns
- Number of elements in the queue
void wiced_hidd_event_queue_init ( wiced_hidd_app_event_queue_t theq,
void *  bufStart_c,
uint8_t  elementSize_c,
uint8_t  maxNumElements_c 
)

Constructor for the circular queue.

The queue will be empty upon creation.

Parameters
theq- pointer to the circular queue
bufStart_c- pointer to buffer where queue data will be stored. Must have enough space to store elementSize_c*maxNumElements_c bytes
elementSize_c- maximum size of each element
maxNumElements_c- size of the queue, i.e. the maximum number of elements that can be kept in the queue. This number must 2 or more. One of the elements will be used to provide an overflow slot functionality
Returns
none
void wiced_hidd_event_queue_remove_current_element ( wiced_hidd_app_event_queue_t theq)

Removes the current element from the queue.

Does nothing if the queue is empty.

Parameters
theq- pointer to the circular queue
Returns
none
uint32_t wiced_hidd_get_bt_clocks_since ( uint32_t  before)

Compute the time elapsed since "before", in Bluetooth clocks.

This functions handles rollovers. Clock resets will cause a large value to be returned (i.e. expiring any timers).

Parameters
before- the previous counter value, as was returned by wiced_hidd_get_current_native_bt_clock().
Returns
the time elapsed, in Bluetooth clocks (312.5 us).
uint32_t wiced_hidd_get_current_native_bt_clock ( void  )

Get the current native Bluetooth clock This counter is 28 bits, and ticks every 312.5 us and is adjusted for drift through sleep, etc.

To compute differences and times elapsed, use wiced_hidd_get_bt_clocks_since().

Parameters
none
Returns
the counter value.
wiced_bool_t wiced_hidd_is_transport_detected ( void  )

Check if transport (UART, USB etc.) is detected.

Parameters
none
Returns
WICED_TRUE/WICED_FALSE
wiced_bool_t wiced_hidd_is_transport_detection_polling_on ( void  )

Check if transport (UART, USB etc.) detection polling is still on-going.

Parameters
none
Returns
WICED_TRUE/WICED_FALSE
void wiced_hidd_register_callback_for_poll_event ( wiced_bt_transport_t  transport_type,
BD_ADDR  peer_bdaddr,
wiced_bool_t  enabled,
void(*)(void *, uint32_t)  callback 
)

Register with the controller with callback function, which will be called just before the poll event from the central if enabled.

For LE link, if enabled, the callback function will be called before every connect event For BR_EDR link, if enabled, the callback function will be called before every sniff or sniff subrate event.

Parameters
transport_type- BT_TRANSPORT_BR_EDR/BT_TRANSPORT_LE
peer_bdaddr- peer device bd address
enabled- enable/disable the callback from controller
callback- callback function
Returns
none