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