1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /******************************************************************************* 8 * 9 * Filename: btc/btc_profile_queue.h 10 * 11 * Description: Bluetooth remote device connection queuing 12 * 13 *******************************************************************************/ 14 15 #ifndef __BTC_PROFILE_QUEUE_H__ 16 #define __BTC_PROFILE_QUEUE_H__ 17 18 #include "common/bt_defs.h" 19 #include "btc/btc_task.h" 20 21 typedef enum { 22 BTC_PRF_QUE_CONNECT = 0, 23 BTC_PRF_QUE_ADVANCE 24 } btc_prf_que_act_t; 25 26 typedef bt_status_t (*btc_connect_cb_t) (bt_bdaddr_t *bda, uint16_t uuid); 27 28 typedef struct connect_node_t { 29 bt_bdaddr_t bda; 30 uint16_t uuid; 31 bool busy; 32 btc_connect_cb_t connect_cb; 33 } connect_node_t; 34 35 /* btc_prf_que_args_t */ 36 typedef union { 37 // BTC_PRF_QUE_CONNECT 38 connect_node_t connect_node; 39 } btc_prf_que_args_t; 40 41 bt_status_t btc_queue_connect(uint16_t uuid, const bt_bdaddr_t *bda, btc_connect_cb_t connect_cb); 42 void btc_queue_advance(void); 43 bt_status_t btc_queue_connect_next(void); 44 void btc_queue_release(void); 45 46 void btc_profile_queue_handler(btc_msg_t *msg); 47 #endif /* __BTC_PROFILE_QUEUE_H__ */ 48