1 /*****************************************************************************
2  * @file    ble_const.h
3  * @author  MDG
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 LL_ONLY
36 #define LL_ONLY 0
37 #endif
38 #ifndef LL_ONLY_BASIC
39 #define LL_ONLY_BASIC 0
40 #endif
41 
42 /* Size of command/events buffers:
43  *
44  * To change the size of commands and events parameters used in the
45  * auto-generated files, you need to update 2 defines:
46  *
47  *  - BLE_CMD_MAX_PARAM_LEN
48  *  - BLE_EVT_MAX_PARAM_LEN
49  *
50  * These 2 defines are set below with default values and can be changed.
51  *
52  * To compute the value to support a characteristic of 512 bytes for a specific
53  * command or an event, you need to look in "ble_types.h".
54  *
55  * Here are 2 examples, one with a command and one with an event:
56  *
57  * - aci_gatt_update_char_value_ext_cp0
58  *   ----------------------------------
59  *
60  *   we have in the structure:
61  *
62  *      uint8_t Value[(BLE_CMD_MAX_PARAM_LEN- 12)/sizeof(uint8_t)];
63  *
64  *   so to support a 512 byte value, we need to have
65  *
66  *   BLE_CMD_MAX_PARAM_LEN at least equal to: 512 + 12 = 524
67  *
68  * - aci_gatt_read_handle_value_rp0
69  *   ------------------------------
70  *
71  *   we have in the structure:
72  *
73  *     uint8_t Value[((BLE_EVT_MAX_PARAM_LEN - 3) - 5)/sizeof(uint8_t)];
74  *
75  *   so to support a 512 byte value, we need to have
76  *
77  *   BLE_EVT_MAX_PARAM_LEN at least equal to: 512 + 3 + 5 = 520
78  *
79  * If you need several events or commands with 512-size values, you need to
80  * take the maximum values for BLE_EVT_MAX_PARAM_LEN and BLE_CMD_MAX_PARAM_LEN.
81  *
82  */
83 
84 /* Maximum parameter size of BLE commands.
85  * Change this value if needed. */
86 #define BLE_CMD_MAX_PARAM_LEN          HCI_COMMAND_MAX_PARAM_LEN
87 
88 /* Maximum parameter size of BLE responses/events.
89  * Change this value if needed. */
90 #define BLE_EVT_MAX_PARAM_LEN          HCI_EVENT_MAX_PARAM_LEN
91 
92 
93 #endif /* BLE_CONST_H__ */
94