1+ #ifndef _PICO_BTSTACK_CONFIG_COMMON_H
2+ #define _PICO_BTSTACK_CONFIG_COMMON_H
3+
4+ #ifndef ENABLE_BLE
5+ #error Please link to pico_btstack_ble
6+ #endif
7+
8+ // BTstack features that can be enabled
9+ #define ENABLE_LE_PERIPHERAL
10+ #define ENABLE_LOG_INFO
11+ #define ENABLE_LOG_ERROR
12+ #define ENABLE_PRINTF_HEXDUMP
13+
14+ // for the client
15+ #if RUNNING_AS_CLIENT
16+ #define ENABLE_LE_CENTRAL
17+ #define MAX_NR_GATT_CLIENTS 1
18+ #else
19+ #define MAX_NR_GATT_CLIENTS 0
20+ #endif
21+
22+ // BTstack configuration. buffers, sizes, ...
23+ #define HCI_OUTGOING_PRE_BUFFER_SIZE 4
24+ #define HCI_ACL_PAYLOAD_SIZE (255 + 4)
25+ #define HCI_ACL_CHUNK_SIZE_ALIGNMENT 4
26+ #define MAX_NR_HCI_CONNECTIONS 1
27+ #define MAX_NR_SM_LOOKUP_ENTRIES 3
28+ #define MAX_NR_WHITELIST_ENTRIES 16
29+ #define MAX_NR_LE_DEVICE_DB_ENTRIES 16
30+
31+ // Limit number of ACL/SCO Buffer to use by stack to avoid cyw43 shared bus overrun
32+ #define MAX_NR_CONTROLLER_ACL_BUFFERS 3
33+ #define MAX_NR_CONTROLLER_SCO_PACKETS 3
34+
35+ // Enable and configure HCI Controller to Host Flow Control to avoid cyw43 shared bus overrun
36+ #define ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL
37+ #define HCI_HOST_ACL_PACKET_LEN (255+4)
38+ #define HCI_HOST_ACL_PACKET_NUM 3
39+ #define HCI_HOST_SCO_PACKET_LEN 120
40+ #define HCI_HOST_SCO_PACKET_NUM 3
41+
42+ // Link Key DB and LE Device DB using TLV on top of Flash Sector interface
43+ #define NVM_NUM_DEVICE_DB_ENTRIES 16
44+ #define NVM_NUM_LINK_KEYS 16
45+
46+ // We don't give btstack a malloc, so use a fixed-size ATT DB.
47+ #define MAX_ATT_DB_SIZE 512
48+
49+ // BTstack HAL configuration
50+ #define HAVE_EMBEDDED_TIME_MS
51+ // map btstack_assert onto Pico SDK assert()
52+ #define HAVE_ASSERT
53+ // Some USB dongles take longer to respond to HCI reset (e.g. BCM20702A).
54+ #define HCI_RESET_RESEND_TIMEOUT_MS 1000
55+ #define ENABLE_SOFTWARE_AES128
56+ #define ENABLE_MICRO_ECC_FOR_LE_SECURE_CONNECTIONS
57+
58+ #endif // _PICO_BTSTACK_CONFIG_COMMON_H
0 commit comments