1 /*****************************************************************************
2  * @file    ble_const.h
3  *
4  * @brief   This file contains the definitions which are compiler dependent.
5  *****************************************************************************
6  * @attention
7  *
8  * Copyright (c) 2018-2024 STMicroelectronics.
9  * All rights reserved.
10  *
11  * This software is licensed under terms that can be found in the LICENSE file
12  * in the root directory of this software component.
13  * If no LICENSE file comes with this software, it is provided AS-IS.
14  *
15  *****************************************************************************
16  */
17 
18 #ifndef BLE_CONST_H__
19 #define BLE_CONST_H__
20 
21 
22 #include <stdint.h>
23 #include <string.h>
24 #include "ble_std.h"
25 #include "ble_defs.h"
26 
27 
28 /* Default BLE variant */
29 #ifndef BASIC_FEATURES
30 #define BASIC_FEATURES 0
31 #endif
32 #ifndef BASIC_PLUS
33 #define BASIC_PLUS 0
34 #endif
35 #ifndef PERIPHERAL_ONLY
36 #define PERIPHERAL_ONLY 0
37 #endif
38 #ifndef LL_ONLY
39 #define LL_ONLY 0
40 #endif
41 #ifndef LL_ONLY_BASIC
42 #define LL_ONLY_BASIC 0
43 #endif
44 
45 /* Size of command/events buffers:
46  *
47  * To change the size of commands and events parameters used in the
48  * auto-generated files, you need to update 2 defines:
49  *
50  *  - BLE_CMD_MAX_PARAM_LEN
51  *  - BLE_EVT_MAX_PARAM_LEN
52  *
53  * These 2 defines are set below with default values and can be changed.
54  *
55  * To compute the value to support a characteristic of 512 bytes for a specific
56  * command or an event, you need to look in "ble_types.h".
57  *
58  * Here are 2 examples, one with a command and one with an event:
59  *
60  * - aci_gatt_update_char_value_ext_cp0
61  *   ----------------------------------
62  *
63  *   we have in the structure:
64  *
65  *      uint8_t Value[(BLE_CMD_MAX_PARAM_LEN- 12)/sizeof(uint8_t)];
66  *
67  *   so to support a 512 byte value, we need to have
68  *
69  *   BLE_CMD_MAX_PARAM_LEN at least equal to: 512 + 12 = 524
70  *
71  * - aci_gatt_read_handle_value_rp0
72  *   ------------------------------
73  *
74  *   we have in the structure:
75  *
76  *     uint8_t Value[((BLE_EVT_MAX_PARAM_LEN - 3) - 5)/sizeof(uint8_t)];
77  *
78  *   so to support a 512 byte value, we need to have
79  *
80  *   BLE_EVT_MAX_PARAM_LEN at least equal to: 512 + 3 + 5 = 520
81  *
82  * If you need several events or commands with 512-size values, you need to
83  * take the maximum values for BLE_EVT_MAX_PARAM_LEN and BLE_CMD_MAX_PARAM_LEN.
84  *
85  */
86 
87 /* Maximum parameter size of BLE commands.
88  * Change this value if needed. */
89 #define BLE_CMD_MAX_PARAM_LEN          HCI_COMMAND_MAX_PARAM_LEN
90 
91 /* Maximum parameter size of BLE responses/events.
92  * Change this value if needed. */
93 #define BLE_EVT_MAX_PARAM_LEN          HCI_EVENT_MAX_PARAM_LEN
94 
95 
96 #endif /* BLE_CONST_H__ */
97