1 #ifndef RWBLE_HL_CONFIG_H_ 2 #define RWBLE_HL_CONFIG_H_ 3 4 #include "rwprf_config.h" 5 #include "rwapp_config.h" 6 7 #define CFG_PRF 8 #define CFG_NB_PRF (BLE_APP_OTA + BLE_APP_GFPS + BLE_VOICEPATH + BLE_BMS + \ 9 BLE_ANC_CLIENT + BLE_AMS_CLIENT + (ANCS_PROXY_ENABLE ? 2 : 0) + \ 10 BLE_APP_DATAPATH_SERVER + BLE_AI_VOICE + BLE_APP_TOTA + BLE_APP_TILE \ 11 + BLE_ADAPTER_PROFILES_NUM + BLE_ADAPTER_SERVER_CLIENT) 12 /** 13 **************************************************************************************** 14 * @addtogroup ROOT 15 * @{ 16 * @name BLE stack configuration 17 * @{ 18 **************************************************************************************** 19 */ 20 21 #include "rwble_hl_error.h" 22 23 /******************************************************************************************/ 24 /* ------------------------- BLE PARTITIONING -------------------------------------*/ 25 /******************************************************************************************/ 26 27 28 /******************************************************************************************/ 29 /* -------------------------- INTERFACES ----------------------------------------*/ 30 /******************************************************************************************/ 31 32 33 #if BLE_APP_PRESENT 34 #define APP_MAIN_TASK TASK_APP 35 #else // BLE_APP_PRESENT 36 #define APP_MAIN_TASK TASK_AHI 37 #endif // BLE_APP_PRESENT 38 39 // Host Controller Interface (Host side) 40 #define BLEHL_HCIH_ITF HCIH_ITF 41 42 /******************************************************************************************/ 43 /* -------------------------- COEX SETUP ----------------------------------------*/ 44 /******************************************************************************************/ 45 46 ///WLAN coex 47 #define BLEHL_WLAN_COEX RW_WLAN_COEX 48 ///WLAN test mode 49 #define BLEHL_WLAN_COEX_TEST RW_WLAN_COEX_TEST 50 51 /******************************************************************************************/ 52 /* -------------------------- HOST MODULES ----------------------------------------*/ 53 /******************************************************************************************/ 54 55 #define BLE_GAPM 1 56 #if (BLE_CENTRAL || BLE_PERIPHERAL) 57 #define BLE_GAPC 1 58 #define BLE_GAPC_HEAP_ENV_SIZE (sizeof(struct gapc_env_tag) + KE_HEAP_MEM_RESERVED) 59 #else //(BLE_CENTRAL || BLE_PERIPHERAL) 60 #define BLE_GAPC 0 61 #define BLE_GAPC_HEAP_ENV_SIZE 0 62 #endif //(BLE_CENTRAL || BLE_PERIPHERAL) 63 64 #if (BLE_CENTRAL || BLE_PERIPHERAL) 65 #define BLE_L2CM 1 66 #define BLE_L2CC 1 67 #define BLE_ATTM 1 68 #define BLE_GATTM 1 69 #define BLE_GATTC 1 70 #define BLE_GATTC_HEAP_ENV_SIZE (sizeof(struct gattc_env_tag) + KE_HEAP_MEM_RESERVED) 71 #define BLE_L2CC_HEAP_ENV_SIZE (sizeof(struct l2cc_env_tag) + KE_HEAP_MEM_RESERVED) 72 #else //(BLE_CENTRAL || BLE_PERIPHERAL) 73 #define BLE_L2CM 0 74 #define BLE_L2CC 0 75 #define BLE_ATTC 0 76 #define BLE_ATTS 0 77 #define BLE_ATTM 0 78 #define BLE_GATTM 0 79 #define BLE_GATTC 0 80 #define BLE_GATTC_HEAP_ENV_SIZE 0 81 #define BLE_L2CC_HEAP_ENV_SIZE 0 82 #endif //(BLE_CENTRAL || BLE_PERIPHERAL) 83 84 #define BLE_SMPM 1 85 #if (BLE_CENTRAL || BLE_PERIPHERAL) 86 #define BLE_SMPC 1 87 #else //(BLE_CENTRAL || BLE_PERIPHERAL) 88 #define BLE_SMPC 0 89 #endif //(BLE_CENTRAL || BLE_PERIPHERAL) 90 91 92 /******************************************************************************************/ 93 /* -------------------------- ATT DB ----------------------------------------*/ 94 /******************************************************************************************/ 95 96 //ATT DB,Testing and Qualification related flags 97 #if (BLE_CENTRAL || BLE_PERIPHERAL) 98 /// Support of External DB Management 99 #if defined(CFG_EXT_DB) 100 #define BLE_EXT_ATT_DB 1 101 #else 102 #define BLE_EXT_ATT_DB 0 103 #endif // defined(CFG_EXT_DB) 104 #else 105 #define BLE_EXT_ATT_DB 0 106 #endif // (BLE_CENTRAL || BLE_PERIPHERAL) 107 /******************************************************************************************/ 108 /* -------------------------- PROFILES ----------------------------------------*/ 109 /******************************************************************************************/ 110 #ifdef CFG_PRF 111 #define BLE_PROFILES (1) 112 /// Number of Profile tasks managed by GAP manager. 113 #define BLE_NB_PROFILES (CFG_NB_PRF) 114 115 #include "rwprf_config.h" 116 #else 117 #define BLE_PROFILES (0) 118 #define BLE_NB_PROFILES (0) 119 #endif // CFG_PRF 120 121 122 #ifndef BLE_ATTS 123 #if (BLE_CENTRAL || BLE_PERIPHERAL || defined(CFG_ATTS)) 124 #define BLE_ATTS 1 125 #else 126 #define BLE_ATTS 0 127 #endif // (BLE_CENTRAL || BLE_PERIPHERAL || defined(CFG_ATTS)) 128 #endif // BLE_ATTS 129 130 131 #ifndef BLE_ATTC 132 #if (BLE_CENTRAL || defined(CFG_ATTC)) 133 #define BLE_ATTC 1 134 #else 135 #define BLE_ATTC 0 136 #endif // (BLE_CENTRAL || defined(CFG_ATTC)) 137 #endif // BLE_ATTC 138 139 #ifndef BLE_LECB 140 #if (BLE_CENTRAL || BLE_PERIPHERAL) 141 #define BLE_LECB 1 142 #else 143 #define BLE_LECB 0 144 #endif // (BLE_CENTRAL || defined(CFG_ATTC)) 145 #endif // BLE_ATTC 146 147 148 /// Attribute Server 149 #if (BLE_ATTS) 150 #define BLE_ATTS 1 151 #else 152 #define BLE_ATTS 0 153 #endif //(BLE_ATTS) 154 155 156 /// Size of the heap 157 #if (BLE_CENTRAL || BLE_PERIPHERAL) 158 /// some heap must be reserved for attribute database 159 #if (BLE_ATTS || BLE_ATTC) 160 #define BLEHL_HEAP_DB_SIZE (1024) 161 #else 162 #define BLEHL_HEAP_DB_SIZE (0) 163 #endif /* (BLE_ATTS || BLE_ATTC) */ 164 165 #define BLEHL_HEAP_MSG_SIZE (2048 + 256 * BLE_CONNECTION_MAX) 166 #else 167 #define BLEHL_HEAP_MSG_SIZE (256) 168 #define BLEHL_HEAP_DB_SIZE (0) 169 #endif /* #if (BLE_CENTRAL || BLE_PERIPHERAL) */ 170 171 172 173 174 /// Number of BLE HL tasks 175 #define BLEHL_TASK_SIZE BLE_HOST_TASK_SIZE + BLE_PRF_TASK_SIZE 176 177 /// Size of environment variable needed on BLE Host Stack for one link 178 #define BLEHL_HEAP_ENV_SIZE ( BLE_GAPC_HEAP_ENV_SIZE + \ 179 BLE_GATTC_HEAP_ENV_SIZE + \ 180 BLE_L2CC_HEAP_ENV_SIZE) 181 182 183 184 185 186 187 188 /* 189 * DEFINES - Mandatory for BLE Host Layers 190 **************************************************************************************** 191 */ 192 /// Maximum time to remain advertising when in the Limited 193 /// Discover able mode: TGAP(lim_adv_timeout) 194 /// required value: 180s: (18000 for ke timer) 195 #define GAP_TMR_LIM_ADV_TIMEOUT 0x4650 196 197 /// Minimum time to perform scanning when performing 198 /// the General Discovery procedure: TGAP(gen_disc_scan_min) 199 /// recommended value: 10.24s: (1024 for ke timer) 200 #define GAP_TMR_GEN_DISC_SCAN 0x0300 201 202 /// Minimum time to perform scanning when performing the 203 /// Limited Discovery procedure: TGAP(lim_disc_scan_min) 204 /// recommended value: 10.24s: (1024 for ke timer) 205 #define GAP_TMR_LIM_DISC_SCAN 0x0300 206 207 /// Minimum time interval between private address change 208 /// TGAP(private_addr_int) 209 /// recommended value: 15 minutes; 0x01F4 for PTS 210 /// 0x3A98 is 150 seconds; 0xEA60 is 10 minutes 211 #define GAP_TMR_PRIV_ADDR_INT 0x3A98 212 213 214 /// Timer used in connection parameter update procedure 215 /// TGAP(conn_param_timeout) 216 /// recommended value: 30 s: (3000 for ke timer) 217 #define GAP_TMR_CONN_PARAM_TIMEOUT 0x0BB8 218 219 /// Timer used in LE credit based connection procedure 220 /// TGAP(lecb_conn_timeout) 221 /// recommended value: 30 s: (3000 for ke timer) 222 #define GAP_TMR_LECB_CONN_TIMEOUT 0x0BB8 223 224 /// Timer used in LE credit based disconnection procedure 225 /// TGAP(lecb_disconn_timeout) 226 /// recommended value: 30 s: (3000 for ke timer) 227 #define GAP_TMR_LECB_DISCONN_TIMEOUT 0x0BB8 228 229 /// Maximal authorized MTU value 230 #define GAP_MAX_LE_MTU (2048) 231 232 /// Maximum GAP device name size 233 #define GAP_MAX_NAME_SIZE (0x20) 234 235 236 237 238 /// Maximum Transmission Unit 239 #define ATT_DEFAULT_MTU (23) 240 /// 30 seconds transaction timer 241 #define ATT_TRANS_RTX (0x0BB8) 242 /// Acceptable encryption key size - strict access 243 #define ATT_SEC_ENC_KEY_SIZE (0x10) 244 245 246 /// Maximum attribute value length 247 #define ATT_MAX_VALUE (GAP_MAX_LE_MTU) 248 249 250 /// @} BLE stack configuration 251 /// @} ROOT 252 253 #endif // RWBLE_HL_CONFIG_H_ 254