CMD, COMMON, CONFIG, GAP, GATTC, GATTS, GTL, L2CAP, STORAGE.
More...
|
| | 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.
|
| |
|
| 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) |
| |
CMD, COMMON, CONFIG, GAP, GATTC, GATTS, GTL, L2CAP, STORAGE.
◆ TASK_2_CONNIDX
| #define TASK_2_CONNIDX |
( |
|
T | ) |
(T >> 8) |
Extract connection index from task ID
◆ ble_gtl_waitqueue_cb_t
| typedef void(* ble_gtl_waitqueue_cb_t) (ble_gtl_msg_t *gtl, void *param) |
◆ ble_cmd_gap_opcode
OP codes for GAP commands
◆ ble_cmd_l2cap_opcode
OP codes for L2CAP commands
◆ alloc_ble_msg()
| void* alloc_ble_msg |
( |
uint16_t |
op_code, |
|
|
uint16_t |
size |
|
) |
| |
Allocates new BLE message.
- Parameters
-
| [in] | op_code | message op code |
| [in] | size | message 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] | cmd | command buffer |
| [out] | rsp | response buffer |
| [in] | handler | command 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_code | event code |
| [in] | size | event 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_id | message ID |
| [in] | dest_id | destination task |
| [in] | len | message 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_id | message ID |
| [in] | dest_id | destination task |
| [in] | conn_idx | connection index |
| [in] | len | message length |
- Returns
- message pointer
◆ ble_gtl_handle_event()
Handle GTL event
This will only handle known events, for other messages it will return without doing anything.
- Parameters
-
| [in] | gtl | GTL 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
-
◆ 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_idx | connection index (for non-connection oriented messages should be 0) |
| [in] | msg_id | message ID |
| [in] | ext_id | extended ID (optional, depending on msg_id) |
| [in] | cb | callback |
| [in] | param | param 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_idx | Connection 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()
Match GTL message against waitqueue
On positive match, this will remove element from waitqueue and fire associated callback.
- Parameters
-
| [in] | gtl | GTL 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_type | message type |
| [in] | len | message 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_mgr_gattc_mtu_changed_ind_evt_handler()
| void ble_mgr_gattc_mtu_changed_ind_evt_handler |
( |
ble_gtl_msg_t * |
gtl | ) |
|
◆ ble_mgr_gatts_read_value_req_evt_handler()
| void ble_mgr_gatts_read_value_req_evt_handler |
( |
ble_gtl_msg_t * |
gtl | ) |
|
◆ ble_mgr_l2cap_connect_ind_evt_handler()
| void ble_mgr_l2cap_connect_ind_evt_handler |
( |
ble_gtl_msg_t * |
gtl | ) |
|
◆ ble_msg_free()
| void ble_msg_free |
( |
void * |
msg | ) |
|
Free BLE message buffer.
- Parameters
-
◆ 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_code | message op code |
| [in] | size | message size |
- Returns
- allocated message pointer