1 #ifndef L2CM_H_ 2 #define L2CM_H_ 3 4 /** 5 **************************************************************************************** 6 * @addtogroup L2C Logical Link Control and Adaptation Protocol 7 * @ingroup HOST 8 * @brief Logical Link Control and Adaptation Protocol - BLE Host. 9 * 10 * The L2C module is responsible for L2CAP provides connection-oriented 11 * and connection-less data services to upper layer protocols with protocol 12 * multiplexing capability and segmentation and re-assembly operation. 13 * 14 * @{ 15 **************************************************************************************** 16 */ 17 /** 18 **************************************************************************************** 19 * @addtogroup L2CM L2CAP Manager 20 * @ingroup L2C 21 * @brief L2CAP block for signaling and resource management functions 22 * 23 * The L2CM is an internal L2CAP block responsible for managing 24 * the signaling messages and propagation of connection and disconnection 25 * related L2CAP messages within the Host. 26 * 27 * @{ 28 **************************************************************************************** 29 */ 30 #include "rwip_config.h" 31 32 #if (BLE_L2CM) 33 #include <stdbool.h> 34 #include <stdint.h> 35 36 /* 37 * INCLUDE FILES 38 **************************************************************************************** 39 */ 40 41 42 /* 43 * DEFINES 44 **************************************************************************************** 45 */ 46 47 /* 48 * GLOBAL VARIABLE DECLARATIONS 49 **************************************************************************************** 50 */ 51 52 /* 53 * FUNCTION DECLARATIONS 54 **************************************************************************************** 55 */ 56 57 /** 58 **************************************************************************************** 59 * @brief Create and Initialize the L2CAP manager task. 60 * 61 * @param[in] reset true if it's requested by a reset; false if it's boot initialization 62 * 63 **************************************************************************************** 64 */ 65 void l2cm_init(bool reset); 66 67 68 69 /** 70 **************************************************************************************** 71 * @brief Allocates an L2CAP resource. 72 * 73 * @param[in] conidx connection index 74 * 75 **************************************************************************************** 76 */ 77 void l2cm_create(uint8_t conidx); 78 79 /** 80 **************************************************************************************** 81 * @brief De-initializes the L2CAP resources for specified link. 82 * 83 * @param[in] conidx connection index 84 * 85 **************************************************************************************** 86 */ 87 void l2cm_cleanup(uint8_t conidx); 88 89 90 /** 91 **************************************************************************************** 92 * @brief Sets link layer buffer size capacity 93 * 94 * @param[in] pkt_len length of the packet 95 * @param[in] nb_acl number of acl 96 * 97 **************************************************************************************** 98 */ 99 void l2cm_set_link_layer_buff_size(uint16_t pkt_len, uint16_t nb_acl); 100 101 /** 102 **************************************************************************************** 103 * @brief Retrieve number of low layer buffer available 104 * 105 * @return Number of low layer buffer available 106 **************************************************************************************** 107 */ 108 uint16_t l2cm_get_nb_buffer_available(void); 109 110 /// @} L2CM 111 112 #endif //(BLE_L2CM) 113 114 #endif // L2CM_H_ 115