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

CMD, COMMON, CONFIG, GAP, GATTC, GATTS, GTL, L2CAP, STORAGE. More...

Modules

 API
 BLE Manager API.
 
 Message Handling
 Helper library API for BLE adapter message handling in BLE Manager.
 
 Commands
 BLE manager command definitions.
 
 Common
 BLE Manager common definitions and handlers.
 
 Configuration
 BLE Manager Configuration.
 
 Storage
 BLE Manager storage interface.
 

Files

file  ble_mgr_gap.h
 BLE manager definitions and handlers for GAP.
 
file  ble_mgr_gattc.h
 BLE manager definitions and handlers for GATTC.
 
file  ble_mgr_gatts.h
 BLE manager definitions and handlers for GATTS.
 
file  ble_mgr_gtl.h
 tbd
 
file  ble_mgr_helper.h
 BLE message creation and handling.
 
file  ble_mgr_l2cap.h
 BLE manager definitions and handlers for L2CAP.
 

Data Structures

struct  ble_mgr_gap_address_set_cmd_t
 
struct  ble_mgr_gap_address_set_rsp_t
 
struct  ble_mgr_gap_device_name_set_cmd_t
 
struct  ble_mgr_gap_device_name_set_rsp_t
 
struct  ble_mgr_gap_appearance_set_cmd_t
 
struct  ble_mgr_gap_appearance_set_rsp_t
 
struct  ble_mgr_gap_ppcp_set_cmd_t
 
struct  ble_mgr_gap_ppcp_set_rsp_t
 
struct  ble_mgr_gap_adv_start_cmd_t
 
struct  ble_mgr_gap_adv_start_rsp_t
 
struct  ble_mgr_gap_adv_stop_cmd_t
 
struct  ble_mgr_gap_adv_stop_rsp_t
 
struct  ble_mgr_gap_adv_data_set_cmd_t
 
struct  ble_mgr_gap_adv_data_set_rsp_t
 
struct  ble_mgr_gap_adv_set_perm_id_cmd_t
 
struct  ble_mgr_gap_adv_set_perm_id_rsp_t
 
struct  ble_mgr_gap_scan_start_cmd_t
 
struct  ble_mgr_gap_scan_start_rsp_t
 
struct  ble_mgr_gap_scan_stop_cmd_t
 
struct  ble_mgr_gap_scan_stop_rsp_t
 
struct  ble_mgr_gap_connect_cmd_t
 
struct  ble_mgr_gap_connect_rsp_t
 
struct  ble_mgr_gap_connect_cancel_cmd_t
 
struct  ble_mgr_gap_connect_cancel_rsp_t
 
struct  ble_mgr_gap_disconnect_cmd_t
 
struct  ble_mgr_gap_disconnect_rsp_t
 
struct  ble_mgr_gap_peer_version_get_cmd_t
 
struct  ble_mgr_gap_peer_version_get_rsp_t
 
struct  ble_mgr_gap_peer_features_get_cmd_t
 
struct  ble_mgr_gap_peer_features_get_rsp_t
 
struct  ble_mgr_gap_conn_rssi_get_cmd_t
 
struct  ble_mgr_gap_conn_rssi_get_rsp_t
 
struct  ble_mgr_gap_role_set_cmd_t
 
struct  ble_mgr_gap_role_set_rsp_t
 
struct  ble_mgr_gap_mtu_size_set_cmd_t
 
struct  ble_mgr_gap_mtu_size_set_rsp_t
 
struct  ble_mgr_gap_channel_map_set_cmd_t
 
struct  ble_mgr_gap_channel_map_set_rsp_t
 
struct  ble_mgr_gap_conn_param_update_cmd_t
 
struct  ble_mgr_gap_conn_param_update_rsp_t
 
struct  ble_mgr_gap_conn_param_update_reply_cmd_t
 
struct  ble_mgr_gap_conn_param_update_reply_rsp_t
 
struct  ble_mgr_gap_pair_cmd_t
 
struct  ble_mgr_gap_pair_rsp_t
 
struct  ble_mgr_gap_pair_reply_cmd_t
 
struct  ble_mgr_gap_pair_reply_rsp_t
 
struct  ble_mgr_gap_passkey_reply_cmd_t
 
struct  ble_mgr_gap_passkey_reply_rsp_t
 
struct  ble_mgr_gap_unpair_cmd_t
 
struct  ble_mgr_gap_unpair_rsp_t
 
struct  ble_mgr_gap_set_sec_level_cmd_t
 
struct  ble_mgr_gap_set_sec_level_rsp_t
 
struct  ble_mgr_gap_data_length_set_cmd_t
 
struct  ble_mgr_gap_data_length_set_rsp_t
 
struct  ble_mgr_gap_address_resolve_cmd_t
 
struct  ble_mgr_gap_address_resolve_rsp_t
 
struct  ble_mgr_gap_tx_power_set_cmd_t
 
struct  ble_mgr_gap_tx_power_set_rsp_t
 
struct  ble_mgr_gap_conn_tx_power_set_cmd_t
 
struct  ble_mgr_gap_conn_tx_power_set_rsp_t
 

Macros

#define TASK_2_CONNIDX(T)   (T >> 8)
 

Typedefs

typedef void(* ble_gtl_waitqueue_cb_t) (ble_gtl_msg_t *gtl, void *param)
 Waitqueue callback. More...
 

Enumerations

enum  ble_cmd_gap_opcode
 
enum  ble_cmd_l2cap_opcode
 

Functions

void ble_mgr_gap_dev_bdaddr_ind_evt_handler (ble_gtl_msg_t *gtl)
 
void ble_mgr_gattc_mtu_changed_ind_evt_handler (ble_gtl_msg_t *gtl)
 
void ble_mgr_gatts_read_value_req_evt_handler (ble_gtl_msg_t *gtl)
 
void * ble_hci_alloc (uint8_t hci_msg_type, uint16_t len)
 Alloc stack API HCI message. More...
 
void * ble_gtl_alloc (uint16_t msg_id, uint16_t dest_id, uint16_t len)
 Alloc stack API GTL message. More...
 
__STATIC_INLINE void * ble_gtl_alloc_with_conn (uint16_t msg_id, uint16_t dest_id, uint16_t conn_idx, uint16_t len)
 Alloc stack API GTL message (with connection index) More...
 
__STATIC_INLINE void ble_gtl_send (void *msg)
 Send stack API GTL message to adapter. More...
 
void ble_gtl_waitqueue_add (uint16_t conn_idx, uint16_t msg_id, uint16_t ext_id, ble_gtl_waitqueue_cb_t cb, void *param)
 Add callback to waitqueue. More...
 
bool ble_gtl_waitqueue_match (ble_gtl_msg_t *gtl)
 
void ble_gtl_waitqueue_flush (uint16_t conn_idx)
 
void ble_gtl_waitqueue_flush_all (void)
 
bool ble_gtl_handle_event (ble_gtl_msg_t *gtl)
 
void * alloc_ble_msg (uint16_t op_code, uint16_t size)
 Allocates new BLE message. More...
 
void * ble_msg_init (uint16_t op_code, uint16_t size)
 Initialize BLE message. More...
 
void * ble_evt_init (uint16_t evt_code, uint16_t size)
 Initialize BLE event. More...
 
void ble_msg_free (void *msg)
 Free BLE message buffer. More...
 
bool ble_cmd_execute (void *cmd, void **rsp, ble_mgr_cmd_handler_t handler)
 Execute BLE command. More...
 
void ble_mgr_l2cap_connect_ind_evt_handler (ble_gtl_msg_t *gtl)
 

Detailed Description

CMD, COMMON, CONFIG, GAP, GATTC, GATTS, GTL, L2CAP, STORAGE.

Macro Definition Documentation

◆ TASK_2_CONNIDX

#define TASK_2_CONNIDX (   T)    (T >> 8)

Extract connection index from task ID

Typedef Documentation

◆ ble_gtl_waitqueue_cb_t

typedef void(* ble_gtl_waitqueue_cb_t) (ble_gtl_msg_t *gtl, void *param)

Waitqueue callback.

Enumeration Type Documentation

◆ ble_cmd_gap_opcode

OP codes for GAP commands

◆ ble_cmd_l2cap_opcode

OP codes for L2CAP commands

Function Documentation

◆ alloc_ble_msg()

void* alloc_ble_msg ( uint16_t  op_code,
uint16_t  size 
)

Allocates new BLE message.

Parameters
[in]op_codemessage op code
[in]sizemessage size
Returns
allocated message pointer

◆ ble_cmd_execute()

bool ble_cmd_execute ( void *  cmd,
void **  rsp,
ble_mgr_cmd_handler_t  handler 
)

Execute BLE command.

This calls manager's handler with command (if BLE_MGR_DIRECT_ACCESS is defined to 1) or sends it to manager's command queue (if BLE_MGR_DIRECT_ACCESS is defined to 0) and waits for response. Buffer pointed by cmd is owned by the BLE manager after calling this function and should not be accessed. Buffer returned in rsp is owned by caller and should be freed there.

Parameters
[in]cmdcommand buffer
[out]rspresponse buffer
[in]handlercommand handler
Returns
true if executed successfully, false otherwise

◆ ble_evt_init()

void* ble_evt_init ( uint16_t  evt_code,
uint16_t  size 
)

Initialize BLE event.

Initialize a BLE event with evt_code and size. This will allocate a buffer with size equal to size and fill it's op_code with evt_code.

Parameters
[in]evt_codeevent code
[in]sizeevent size
Returns
allocated event buffer pointer

◆ ble_gtl_alloc()

void* ble_gtl_alloc ( uint16_t  msg_id,
uint16_t  dest_id,
uint16_t  len 
)

Alloc stack API GTL message.

Message will be set to TASK_GTL as source task.

Parameters
[in]msg_idmessage ID
[in]dest_iddestination task
[in]lenmessage length
Returns
message pointer

◆ ble_gtl_alloc_with_conn()

__STATIC_INLINE void* ble_gtl_alloc_with_conn ( uint16_t  msg_id,
uint16_t  dest_id,
uint16_t  conn_idx,
uint16_t  len 
)

Alloc stack API GTL message (with connection index)

This is the same as ble_gtl_alloc() except it should be used when sending message to a task which is multi-instantiated (i.e. includes connection index in task ID).

Parameters
[in]msg_idmessage ID
[in]dest_iddestination task
[in]conn_idxconnection index
[in]lenmessage length
Returns
message pointer

◆ ble_gtl_handle_event()

bool ble_gtl_handle_event ( ble_gtl_msg_t gtl)

Handle GTL event

This will only handle known events, for other messages it will return without doing anything.

Parameters
[in]gtlGTL message pointer
Returns
true if handled, false otherwise

◆ ble_gtl_send()

__STATIC_INLINE void ble_gtl_send ( void *  msg)

Send stack API GTL message to adapter.

Parameters
[in]msgmessage pointer

◆ ble_gtl_waitqueue_add()

void ble_gtl_waitqueue_add ( uint16_t  conn_idx,
uint16_t  msg_id,
uint16_t  ext_id,
ble_gtl_waitqueue_cb_t  cb,
void *  param 
)

Add callback to waitqueue.

This adds callback for waitqueue associated with specific message ID and optional extended ID (if required, for example 'operation' in GATM and 'seq_num' in GATTC).

Parameters
[in]conn_idxconnection index (for non-connection oriented messages should be 0)
[in]msg_idmessage ID
[in]ext_idextended ID (optional, depending on msg_id)
[in]cbcallback
[in]paramparam for callback

◆ ble_gtl_waitqueue_flush()

void ble_gtl_waitqueue_flush ( uint16_t  conn_idx)

Flush waitqueue of connection-related elements

On positive match, this will remove element from waitqueue and fire associated callback with NULL GTL message pointer.

Parameters
[in]conn_idxConnection index that corresponds to disconnected device

◆ ble_gtl_waitqueue_flush_all()

void ble_gtl_waitqueue_flush_all ( void  )

Flush all waitqueue elements

This will remove all elements from waitqueue and free all associated param buffers.

◆ ble_gtl_waitqueue_match()

bool ble_gtl_waitqueue_match ( ble_gtl_msg_t gtl)

Match GTL message against waitqueue

On positive match, this will remove element from waitqueue and fire associated callback.

Parameters
[in]gtlGTL message pointer
Returns
true if matches, false otherwise

◆ ble_hci_alloc()

void* ble_hci_alloc ( uint8_t  hci_msg_type,
uint16_t  len 
)

Alloc stack API HCI message.

Parameters
[in]hci_msg_typemessage type
[in]lenmessage length
Returns
message pointer

◆ ble_mgr_gap_dev_bdaddr_ind_evt_handler()

void ble_mgr_gap_dev_bdaddr_ind_evt_handler ( ble_gtl_msg_t gtl)

BLE stack event handlers

◆ ble_mgr_gattc_mtu_changed_ind_evt_handler()

void ble_mgr_gattc_mtu_changed_ind_evt_handler ( ble_gtl_msg_t gtl)

BLE stack event handlers

◆ ble_mgr_gatts_read_value_req_evt_handler()

void ble_mgr_gatts_read_value_req_evt_handler ( ble_gtl_msg_t gtl)

BLE stack event handlers

◆ ble_mgr_l2cap_connect_ind_evt_handler()

void ble_mgr_l2cap_connect_ind_evt_handler ( ble_gtl_msg_t gtl)

BLE stack event handlers

◆ ble_msg_free()

void ble_msg_free ( void *  msg)

Free BLE message buffer.

Parameters
[in]msgMessage buffer

◆ ble_msg_init()

void* ble_msg_init ( uint16_t  op_code,
uint16_t  size 
)

Initialize BLE message.

Initialize a BLE message with op_code and size. This will allocate a buffer with size equal to size and fill it's op_code with op_code.

Parameters
[in]op_codemessage op code
[in]sizemessage size
Returns
allocated message pointer