|
1 | 1 | /*****************************************************************************
|
2 | 2 | * @file ble_bufsize.h
|
3 |
| - * @author MCD |
| 3 | + * @author MDG |
4 | 4 | * @brief Definition of BLE stack buffers size
|
5 | 5 | *****************************************************************************
|
6 | 6 | * @attention
|
7 | 7 | *
|
8 |
| - * Copyright (c) 2018-2021 STMicroelectronics. |
| 8 | + * Copyright (c) 2018-2022 STMicroelectronics. |
9 | 9 | * All rights reserved.
|
10 | 10 | *
|
11 | 11 | * This software is licensed under terms that can be found in the LICENSE file
|
|
97 | 97 | * mentioned parameters.
|
98 | 98 | */
|
99 | 99 | #if (BEACON_ONLY != 0)
|
100 |
| -#define BLE_FIXED_BUFFER_SIZE_BYTES 4184 /* Beacon only */ |
| 100 | +#define BLE_FIXED_BUFFER_SIZE_BYTES 4076 /* Beacon only */ |
101 | 101 | #elif (LL_ONLY != 0)
|
102 |
| -#define BLE_FIXED_BUFFER_SIZE_BYTES 6068 /* LL only */ |
| 102 | +#define BLE_FIXED_BUFFER_SIZE_BYTES 5936 /* LL only */ |
103 | 103 | #elif (SLAVE_ONLY != 0)
|
104 |
| -#define BLE_FIXED_BUFFER_SIZE_BYTES 6096 /* Peripheral only */ |
| 104 | +#define BLE_FIXED_BUFFER_SIZE_BYTES 6204 /* Peripheral only */ |
105 | 105 | #elif (BASIC_FEATURES != 0)
|
106 |
| -#define BLE_FIXED_BUFFER_SIZE_BYTES 6400 /* Basic Features */ |
| 106 | +#define BLE_FIXED_BUFFER_SIZE_BYTES 6532 /* Basic Features */ |
107 | 107 | #else
|
108 |
| -#define BLE_FIXED_BUFFER_SIZE_BYTES 7312 /* Full stack */ |
| 108 | +#define BLE_FIXED_BUFFER_SIZE_BYTES 7052 /* Full stack */ |
109 | 109 | #endif
|
110 | 110 |
|
111 | 111 | /*
|
112 | 112 | * BLE_PER_LINK_SIZE_BYTES: additional memory size used per link
|
113 | 113 | */
|
114 | 114 | #if (BEACON_ONLY != 0)
|
115 |
| -#define BLE_PER_LINK_SIZE_BYTES 192 /* Beacon only */ |
| 115 | +#define BLE_PER_LINK_SIZE_BYTES 128 /* Beacon only */ |
116 | 116 | #elif (LL_ONLY != 0)
|
117 | 117 | #define BLE_PER_LINK_SIZE_BYTES 260 /* LL only */
|
118 | 118 | #elif (SLAVE_ONLY != 0)
|
119 |
| -#define BLE_PER_LINK_SIZE_BYTES 388 /* Peripheral only */ |
| 119 | +#define BLE_PER_LINK_SIZE_BYTES 392 /* Peripheral only */ |
120 | 120 | #elif (BASIC_FEATURES != 0)
|
121 |
| -#define BLE_PER_LINK_SIZE_BYTES 388 /* Basic Features */ |
| 121 | +#define BLE_PER_LINK_SIZE_BYTES 440 /* Basic Features */ |
122 | 122 | #else
|
123 | 123 | #define BLE_PER_LINK_SIZE_BYTES 444 /* Full stack */
|
124 | 124 | #endif
|
|
141 | 141 | /*
|
142 | 142 | * BLE_EXT_ADV_BUFFER_SIZE
|
143 | 143 | * additional memory size used for Extended advertising;
|
144 |
| - * It has to be added to BLE_TOTAL_BUFFER_SIZE(). |
145 |
| - * The formula used is based on:(1792 + ((set_nbr) * (60 + (2 * (data_len))))) |
| 144 | + * It has to be added to BLE_TOTAL_BUFFER_SIZE() if the Extended advertising |
| 145 | + * feature is used. |
| 146 | + * |
| 147 | + * @param set_nbr: Maximum number of advertising sets. |
| 148 | + * Valid values are from 1 to 8. |
| 149 | + * |
| 150 | + * @param data_len: Maximum size of advertising data. |
| 151 | + * Valid values are from 31 to 1650. |
146 | 152 | */
|
147 |
| -#define BLE_EXT_ADV_BUFFER_SIZE(set_nbr, data_len) (7596) |
| 153 | +#define BLE_EXT_ADV_BUFFER_SIZE(set_nbr, data_len) \ |
| 154 | + (2304 + ((892 + (DIVC(data_len, 207) * 244)) * (set_nbr))) |
148 | 155 |
|
149 | 156 | /*
|
150 | 157 | * BLE_TOTAL_BUFFER_SIZE_GATT: this macro returns the amount of memory,
|
|
0 commit comments