1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 */ 4 #ifndef __BRIDGE_H__ 5 #define __BRIDGE_H__ 6 7 #if !defined(ENHANCED_STACK) 8 #include "hci.h" 9 #endif 10 11 #include "ke_msg.h" 12 13 #if defined(ENHANCED_STACK) 14 15 typedef struct { 16 uint8_t *buffer; 17 uint16_t buffer_len; 18 uint8_t *priv; 19 uint16_t conn_handle_flags; 20 } BridgeBuffer; 21 22 typedef struct { 23 U8 *param; 24 U8 param_len; 25 uint8_t event; 26 BridgeBuffer *rx_buff; 27 } BridgeEvent; 28 29 #else 30 31 typedef HciEvent BridgeEvent; 32 typedef HciBuffer BridgeBuffer; 33 34 #endif /* ENHANCED_STACK */ 35 36 void bridge_hcif_send_acl(struct ke_msg *msg); 37 void bridge_hcif_recv_acl(BridgeBuffer * pBuffer); 38 void bridge_free_rx_buffer(BridgeBuffer *pBuffer); 39 void bridge_free_tx_buffer(BridgeBuffer *pBuffer); 40 void bridge_hci_ble_event(const BridgeEvent* event); 41 uint8_t bridge_is_cmd_opcode_supported(uint16_t opcode); 42 void bridge_free_token(void * token); 43 U8 bridge_check_ble_handle_valid(U16 handle); 44 void bridge_hcif_send_cmd(struct ke_msg *msg); 45 46 #endif 47