SmartSnippets DA1459x SDK
ble_mgr_gtl.h
Go to the documentation of this file.
1 
41 #ifndef BLE_MGR_GTL_H_
42 #define BLE_MGR_GTL_H_
43 
44 #include <stdbool.h>
45 #include "ad_ble.h"
46 
48 #define TASK_2_CONNIDX(T) (T >> 8)
49 
54 typedef void (* ble_gtl_waitqueue_cb_t) (ble_gtl_msg_t *gtl, void *param);
55 
65 void *ble_hci_alloc(uint8_t hci_msg_type, uint16_t len);
66 
79 void *ble_gtl_alloc(uint16_t msg_id, uint16_t dest_id, uint16_t len);
80 
95 __STATIC_INLINE void *ble_gtl_alloc_with_conn(uint16_t msg_id, uint16_t dest_id,
96  uint16_t conn_idx, uint16_t len)
97 {
98  return ble_gtl_alloc(msg_id, conn_idx << 8 | (dest_id & 0xFF), len);
99 }
100 
107 __STATIC_INLINE void ble_gtl_send(void *msg)
108 {
109  ad_ble_command_queue_send(&msg, OS_QUEUE_FOREVER);
110 }
111 
124 void ble_gtl_waitqueue_add(uint16_t conn_idx, uint16_t msg_id, uint16_t ext_id,
125  ble_gtl_waitqueue_cb_t cb, void *param);
126 
138 
147 void ble_gtl_waitqueue_flush(uint16_t conn_idx);
148 
155 void ble_gtl_waitqueue_flush_all(void);
156 
168 
169 #endif /* BLE_MGR_GTL_H_ */
170 
ble_hci_alloc
void * ble_hci_alloc(uint8_t hci_msg_type, uint16_t len)
Alloc stack API HCI message.
ble_gtl_waitqueue_cb_t
void(* ble_gtl_waitqueue_cb_t)(ble_gtl_msg_t *gtl, void *param)
Waitqueue callback.
Definition: ble_mgr_gtl.h:54
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.
ble_gtl_alloc
void * ble_gtl_alloc(uint16_t msg_id, uint16_t dest_id, uint16_t len)
Alloc stack API GTL message.
ble_gtl_msg
Definition: ad_ble.h:212
ble_gtl_send
__STATIC_INLINE void ble_gtl_send(void *msg)
Send stack API GTL message to adapter.
Definition: ble_mgr_gtl.h:107
ble_gtl_waitqueue_match
bool ble_gtl_waitqueue_match(ble_gtl_msg_t *gtl)
ble_gtl_waitqueue_flush_all
void ble_gtl_waitqueue_flush_all(void)
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)
Definition: ble_mgr_gtl.h:95
ble_gtl_handle_event
bool ble_gtl_handle_event(ble_gtl_msg_t *gtl)
ad_ble.h
BLE Adapter API.
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.
ble_gtl_waitqueue_flush
void ble_gtl_waitqueue_flush(uint16_t conn_idx)
msg
Structure for messages with id, type, data.
Definition: msg_queues.h:144