SmartSnippets DA1459x SDK
Files | Data Structures | Macros | Typedefs | Functions

BLE Adapter API. More...

Files

file  ad_ble.h
 BLE Adapter API.
 

Data Structures

struct  ble_hci_cmd_hdr
 
struct  ble_hci_acl_msg_hdr
 
struct  ble_hci_sco_hdr
 
struct  ble_hci_evt_hdr
 
struct  hci_cmd_msg
 
struct  hci_acl_msg
 
struct  hci_sco_msg
 
struct  hci_evt_msg
 
struct  ble_hci_msg
 
struct  ble_gtl_msg
 
struct  ble_stack_msg
 
struct  ad_ble_msg
 
struct  ad_ble_hdr
 
struct  ad_ble_interface_t
 
struct  ad_ble_lld_stats
 Structure for low level driver statistics. More...
 

Macros

#define HCI_CMD_HEADER_LENGTH   3
 Kernel message header length for transport through interface between App and SW stack.
 

Typedefs

typedef struct ble_hci_cmd_hdr ble_hci_cmd_hdr_t
 
typedef struct ble_hci_acl_msg_hdr ble_hci_acl_hdr_t
 
typedef struct ble_hci_sco_hdr ble_hci_sco_hdr_t
 
typedef struct ble_hci_evt_hdr ble_hci_evt_hdr_t
 
typedef struct hci_cmd_msg hci_cmd_msg_t
 
typedef struct hci_acl_msg hci_acl_msg_t
 
typedef struct hci_sco_msg hci_sco_msg_t
 
typedef struct hci_evt_msg hci_evt_msg_t
 
typedef struct ble_hci_msg ble_hci_msg_t
 
typedef struct ble_gtl_msg ble_gtl_msg_t
 
typedef struct ble_stack_msg ble_stack_msg_t
 
typedef struct ad_ble_msg ad_ble_msg_t
 
typedef struct ad_ble_hdr ad_ble_hdr_t
 

Functions

OS_BASE_TYPE ad_ble_command_queue_send (const void *item, OS_TICK_TIME wait_ticks)
 Send a message to the BLE adapter command queue. More...
 
void ad_ble_lpclock_available (void)
 Notify the BLE adapter that LP clock is available. More...
 
OS_BASE_TYPE ad_ble_event_queue_send (const void *item, OS_TICK_TIME wait_ticks)
 Send a message to the BLE adapter event queue. More...
 
void ad_ble_task_notify (uint32_t value)
 Notify BLE adapter. More...
 
void ad_ble_init (void)
 Initialize BLE adapter - create command and event queues. More...
 
const ad_ble_interface_tad_ble_get_interface (void)
 Get BLE Adapter interface. More...
 
OS_BASE_TYPE ad_ble_event_queue_register (const OS_TASK task_handle)
 Register task for BLE Adapter's event Queue notifications. More...
 
void ad_ble_get_public_address (uint8_t address[BD_ADDR_LEN])
 Get public static address. More...
 
bool ad_ble_read_nvms_param (uint8_t *param, uint8_t len, uint8_t nvparam_tag, uint32_t nvms_addr)
 Read configuration parameters form NVMS parameter area. More...
 
void ad_ble_get_irk (uint8_t irk[KEY_LEN])
 Get device's IRK. More...
 
void ad_ble_notify_event_queue_avail (void)
 Notifies BLE adapter that there is free space on the event queue.
 
nvparam_t ad_ble_get_nvparam_handle (void)
 Get non-volatile parameter handle. More...
 
void ad_ble_stay_active (bool status)
 Force BLE to stay active. More...
 
bool ad_ble_non_retention_heap_in_use (void)
 Check if the non retention BLE heap is in use.
 
void ad_ble_sys_tcs_config (void)
 Configure CMAC SYS TCS table.
 
void ad_ble_get_lld_stats (struct ad_ble_lld_stats *stats)
 Gets low level driver statistics.
 

Detailed Description

BLE Adapter API.

Typedef Documentation

◆ ad_ble_hdr_t

typedef struct ad_ble_hdr ad_ble_hdr_t

BLE adapter message header structure

◆ ad_ble_msg_t

typedef struct ad_ble_msg ad_ble_msg_t

BLE adapter message structure

◆ ble_gtl_msg_t

typedef struct ble_gtl_msg ble_gtl_msg_t

GTL message format

◆ ble_hci_acl_hdr_t

HCI ACL data message header format

◆ ble_hci_cmd_hdr_t

HCI command message header format

◆ ble_hci_evt_hdr_t

HCI event message header format

◆ ble_hci_msg_t

typedef struct ble_hci_msg ble_hci_msg_t

HCI message format

◆ ble_hci_sco_hdr_t

HCI synchronous data message header format

◆ ble_stack_msg_t

BLE stack message structure

◆ hci_acl_msg_t

typedef struct hci_acl_msg hci_acl_msg_t

HCI ACL data message format

◆ hci_cmd_msg_t

typedef struct hci_cmd_msg hci_cmd_msg_t

HCI command message format

◆ hci_evt_msg_t

typedef struct hci_evt_msg hci_evt_msg_t

HCI event message format

◆ hci_sco_msg_t

typedef struct hci_sco_msg hci_sco_msg_t

HCI synchronous data message format

Function Documentation

◆ ad_ble_command_queue_send()

OS_BASE_TYPE ad_ble_command_queue_send ( const void *  item,
OS_TICK_TIME  wait_ticks 
)

Send a message to the BLE adapter command queue.

Sends a message to the BLE adapter command queue and notifies the BLE adapter task.

Parameters
[in]itemPointer to the item to be sent to the queue.
[in]wait_ticksMax time in ticks to wait for space in queue.
Returns
OS_OK if the message was successfully sent to the queue, OS_FAIL otherwise.

◆ ad_ble_event_queue_register()

OS_BASE_TYPE ad_ble_event_queue_register ( const OS_TASK  task_handle)

Register task for BLE Adapter's event Queue notifications.

Parameters
[in]task_handleThe handle of the FreeRTOS task that registers for notifications.
Returns
pdPASS if task is successfully registered, pdFAIL otherwise.

◆ ad_ble_event_queue_send()

OS_BASE_TYPE ad_ble_event_queue_send ( const void *  item,
OS_TICK_TIME  wait_ticks 
)

Send a message to the BLE adapter event queue.

Sends a message to the BLE adapter event queue and notifies the registered task.

Parameters
[in]itemPointer to the item to be sent to the queue.
[in]wait_ticksMax time in ticks to wait for space in queue
Returns
OS_OK if the message was successfully sent to the queue, OS_FAIL otherwise.

◆ ad_ble_get_interface()

const ad_ble_interface_t* ad_ble_get_interface ( void  )

Get BLE Adapter interface.

Returns
adapter interface pointer

◆ ad_ble_get_irk()

void ad_ble_get_irk ( uint8_t  irk[KEY_LEN])

Get device's IRK.

This will be either the IRK read from NVMS or the default IRK.

Parameters
[out]irkDevice's IRK

◆ ad_ble_get_nvparam_handle()

nvparam_t ad_ble_get_nvparam_handle ( void  )

Get non-volatile parameter handle.

Function gets parameter handle to be used

Returns
valid parameter handle on success, NULL otherwise

◆ ad_ble_get_public_address()

void ad_ble_get_public_address ( uint8_t  address[BD_ADDR_LEN])

Get public static address.

This will be either the address read from NVMS or the default address. Since this address does not change once it has been loaded, it's safe to call it at any time from any task

Parameters
[out]addressPublic static address

◆ ad_ble_init()

void ad_ble_init ( void  )

Initialize BLE adapter - create command and event queues.

◆ ad_ble_lpclock_available()

void ad_ble_lpclock_available ( void  )

Notify the BLE adapter that LP clock is available.

This will send a notification to the BLE adapter informing it for the availability of the LP clock. From that moment onwards the BLE stack is allowed to enter the sleep state.

◆ ad_ble_read_nvms_param()

bool ad_ble_read_nvms_param ( uint8_t *  param,
uint8_t  len,
uint8_t  nvparam_tag,
uint32_t  nvms_addr 
)

Read configuration parameters form NVMS parameter area.

Parameters
[out]paramstorage for the read parameter
[in]lenlength of data to read
[in]nvparam_tagparameter tag
[in]nvms_addroffset address
Returns
true if parameter exists, false otherwise

◆ ad_ble_stay_active()

void ad_ble_stay_active ( bool  status)

Force BLE to stay active.

Forcing BLE to stay active could be helpful in periods with notable BLE traffic. This will result to reduced interrupt latencies, as BLE is not going to wake up too often due to the expected traffic load.

Parameters
[in]statusdefines if BLE sleep in allowed or not

◆ ad_ble_task_notify()

void ad_ble_task_notify ( uint32_t  value)

Notify BLE adapter.

Send a task notification on value notification bit(s) to the BLE adapter task.

Parameters
[in]valueNotification mask to be set.