AIROC™ BTSDK v4.0 - Documentation | ||||
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... | |
HIDD Functions.
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.
allow | - WICED_TRUE (allow peripheral latency) or WICED_FALSE (disable peripheral latency) |
uint16_t wiced_blehidd_get_att_mtu_size | ( | BD_ADDR | bda | ) |
bda | - peer device BD Address |
uint16_t wiced_blehidd_get_connection_handle | ( | void | ) |
Get Connection Handle, which is returned by controller in the LE connection complete event.
none |
uint16_t wiced_blehidd_get_connection_interval | ( | void | ) |
Get Connection Interval.
none |
uint8_t* wiced_blehidd_get_peer_addr | ( | void | ) |
Get the peer (current LE connected) device BD Address.
none |
uint8_t wiced_blehidd_get_peer_addr_type | ( | void | ) |
Get the peer (current LE connected) device address Type.
none |
uint16_t wiced_blehidd_get_peripheral_latency | ( | void | ) |
Get Connection Peripheral Latency.
none |
uint16_t wiced_blehidd_get_supervision_timeout | ( | void | ) |
Get Supervision Timeout.
none |
wiced_bool_t wiced_blehidd_is_device_bonded | ( | void | ) |
Check if the current LE connected device is bonded with us.
none |
wiced_bool_t wiced_blehidd_is_link_encrypted | ( | void | ) |
Check if the current LE connection is encrypted.
none |
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.
none |
void wiced_blehidd_register_report_table | ( | wiced_blehidd_report_gatt_characteristic_t * | table, |
uint32_t | num | ||
) |
register HID report table for sending and receiving
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
gatts_conn_id | - GATT connection ID |
reportID | - report ID |
reportType | - report type. |
data | - pointer to report data |
length | - length of the report data |
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
connHandle | - connection handle |
latency | - peripheral latency |
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
is_bonded | - WICED_TRUE/WICED_FALSE |
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
is_encrypted | - WICED_TRUE/WICED_FALSE |
wiced_bt_gatt_status_t wiced_blehidd_write_handler | ( | void * | data | ) |
Handle GATT write cmd/req for HID reports.
data | - pointer point to GATT attribute |
void wiced_bthidd_setDefaultLinkSupervisionTimeout | ( | UINT16 | slots | ) |
set the default Link Supervision Timeout value
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.
dev_type | - BT_DEVICE_TYPE_BREDR or BT_DEVICE_TYPE_BLE or BT_DEVICE_TYPE_BREDR_BLE |
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.
theq | - pointer to the circular queue |
event | - pointer to event to queue |
len | -length of event |
pollSeqn | -the poll SEQN |
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.
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.
theq | - pointer to the circular queue |
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.
theq | - pointer to the circular 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.
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 |
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.
theq | - pointer to the circular queue |
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).
before | - the previous counter value, as was returned by wiced_hidd_get_current_native_bt_clock(). |
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().
none |
wiced_bool_t wiced_hidd_is_transport_detected | ( | void | ) |
Check if transport (UART, USB etc.) is detected.
none |
wiced_bool_t wiced_hidd_is_transport_detection_polling_on | ( | void | ) |
Check if transport (UART, USB etc.) detection polling is still on-going.
none |
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.
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 |