1
+ /* USER CODE BEGIN Header */
1
2
/**
2
3
******************************************************************************
3
4
* File Name : app_conf.h
4
5
* Description : Application configuration file for STM32WPAN Middleware.
5
- *
6
- ******************************************************************************
6
+ ******************************************************************************
7
7
* @attention
8
8
*
9
- * <h2><center>© Copyright (c) 2019 STMicroelectronics.
9
+ * <h2><center>© Copyright (c) 2020 STMicroelectronics.
10
10
* All rights reserved.</center></h2>
11
11
*
12
- * This software component is licensed by ST under BSD 3-Clause license,
13
- * the "License"; You may not use this file except in compliance with the
14
- * License. You may obtain a copy of the License at:
15
- * opensource.org/licenses/BSD-3-Clause
12
+ * This software component is licensed by ST under Ultimate Liberty license
13
+ * SLA0044, the "License"; You may not use this file except in compliance with
14
+ * the License. You may obtain a copy of the License at:
15
+ * www.st.com/SLA0044
16
16
*
17
17
******************************************************************************
18
18
*/
19
+ /* USER CODE END Header */
19
20
20
21
/* Define to prevent recursive inclusion -------------------------------------*/
21
22
#ifndef APP_CONF_H
22
23
#define APP_CONF_H
23
24
24
25
26
+ #include "hw.h"
27
+ #include "ble_bufsize.h"
28
+
29
+
25
30
/******************************************************************************
26
31
* Application Config
27
32
******************************************************************************/
31
36
/**
32
37
* Define Tx Power
33
38
*/
34
- #define CFG_TX_POWER (0x18) /**< 0dbm */
39
+ #define CFG_TX_POWER (0x18) /* -0.15dBm */
35
40
36
41
/**
37
42
* Define Advertising parameters
45
50
/**
46
51
* Define IO Authentication
47
52
*/
48
- #define CFG_BONDING_MODE (1 )
49
- #define CFG_FIXED_PIN (111111)
50
- #define CFG_USED_FIXED_PIN (0)
51
- #define CFG_ENCRYPTION_KEY_SIZE_MAX (16)
52
- #define CFG_ENCRYPTION_KEY_SIZE_MIN (8)
53
+ #define CFG_BONDING_MODE (0 )
54
+ #define CFG_FIXED_PIN (111111)
55
+ #define CFG_USED_FIXED_PIN (0)
56
+ #define CFG_ENCRYPTION_KEY_SIZE_MAX (16)
57
+ #define CFG_ENCRYPTION_KEY_SIZE_MIN (8)
53
58
54
59
/**
55
60
* Define IO capabilities
60
65
#define CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT (0x03)
61
66
#define CFG_IO_CAPABILITY_KEYBOARD_DISPLAY (0x04)
62
67
63
- #define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_DISPLAY_YES_NO
68
+ #define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT
64
69
65
70
/**
66
71
* Define MITM modes
71
76
#define CFG_MITM_PROTECTION CFG_MITM_PROTECTION_REQUIRED
72
77
73
78
/**
74
- * Define PHY
79
+ * Define Secure Connections Support
80
+ */
81
+ #define CFG_SECURE_NOT_SUPPORTED (0x00)
82
+ #define CFG_SECURE_OPTIONAL (0x01)
83
+ #define CFG_SECURE_MANDATORY (0x02)
84
+
85
+ #define CFG_SC_SUPPORT CFG_SECURE_OPTIONAL
86
+
87
+ /**
88
+ * Define Keypress Notification Support
75
89
*/
76
- #define ALL_PHYS_PREFERENCE 0x00
77
- #define RX_2M_PREFERRED 0x02
78
- #define TX_2M_PREFERRED 0x02
79
- #define TX_1M 0x01
80
- #define TX_2M 0x02
81
- #define RX_1M 0x01
82
- #define RX_2M 0x02
90
+ #define CFG_KEYPRESS_NOT_SUPPORTED (0x00)
91
+ #define CFG_KEYPRESS_SUPPORTED (0x01)
92
+
93
+ #define CFG_KEYPRESS_NOTIFICATION_SUPPORT CFG_KEYPRESS_NOT_SUPPORTED
94
+
95
+ /**
96
+ * Numeric Comparison Answers
97
+ */
98
+ #define YES (0x01)
99
+ #define NO (0x00)
100
+
101
+ /**
102
+ * Device name configuration for Generic Access Service
103
+ */
104
+ #define CFG_GAP_DEVICE_NAME "TEMPLATE"
105
+ #define CFG_GAP_DEVICE_NAME_LENGTH (8)
83
106
84
107
/**
85
108
* Identity root key used to derive LTK and CSRK
102
125
103
126
/**< specific parameters */
104
127
/*****************************************************/
128
+
105
129
/**
106
- * AD Element - Group B Feature
107
- */
108
- /* LSB - Second Byte */
109
- #define CFG_FEATURE_OTA_REBOOT (0x20)
130
+ * Beacon selection
131
+ * Beacons are all exclusive
132
+ */
133
+ #define CFG_EDDYSTONE_UID_BEACON_TYPE (1<<0)
134
+ #define CFG_EDDYSTONE_URL_BEACON_TYPE (1<<1)
135
+ #define CFG_EDDYSTONE_TLM_BEACON_TYPE (1<<2)
136
+ #define CFG_IBEACON (1<<3)
137
+
138
+ #define CFG_BEACON_TYPE (CFG_IBEACON)
139
+
140
+ #define OTA_BEACON_DATA_ADDRESS FLASH_BASE + 0x6000
141
+ #define OFFSET_PAYLOAD_LENGTH 9
142
+ #define OFFSET_PAYLOAD_DATA 10
110
143
111
144
/******************************************************************************
112
145
* BLE Stack
150
183
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
151
184
152
185
/**
153
- * Prepare Write List size in terms of number of packet with ATT_MTU=23 bytes
186
+ * Prepare Write List size in terms of number of packet
154
187
*/
155
- #define CFG_BLE_PREPARE_WRITE_LIST_SIZE ( 0x3A )
188
+ #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU )
156
189
157
190
/**
158
191
* Number of allocated memory blocks
159
192
*/
160
- #define CFG_BLE_MBLOCK_COUNT ( 0x79 )
193
+ #define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK) )
161
194
162
195
/**
163
196
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
211
244
* 1 : LL Only
212
245
* 0 : LL + Host
213
246
*/
214
- #define CFG_BLE_LL_ONLY 1
247
+ #define CFG_BLE_LL_ONLY 0
215
248
/******************************************************************************
216
249
* Transport Layer
217
250
******************************************************************************/
250
283
* Select UART interfaces
251
284
*/
252
285
#define CFG_DEBUG_TRACE_UART hw_uart1
253
- #define CFG_CONSOLE_MENU
286
+ #define CFG_CONSOLE_MENU 0
254
287
/******************************************************************************
255
288
* USB interface
256
289
******************************************************************************/
346
379
347
380
typedef enum
348
381
{
349
- CFG_TIM_PROC_ID_ISR ,
382
+ CFG_TIM_PROC_ID_ISR ,
350
383
} CFG_TimProcID_t ;
351
384
352
385
/******************************************************************************
@@ -365,17 +398,17 @@ typedef enum
365
398
* keep debugger enabled while in any low power mode when set to 1
366
399
* should be set to 0 in production
367
400
*/
368
- #define CFG_DEBUGGER_SUPPORTED 0
401
+ #define CFG_DEBUGGER_SUPPORTED 1
369
402
370
403
/**
371
404
* When set to 1, the traces are enabled in the BLE services
372
405
*/
373
- #define CFG_DEBUG_BLE_TRACE 0
406
+ #define CFG_DEBUG_BLE_TRACE 1
374
407
375
408
/**
376
409
* Enable or Disable traces in application
377
410
*/
378
- #define CFG_DEBUG_APP_TRACE 0
411
+ #define CFG_DEBUG_APP_TRACE 1
379
412
380
413
#if (CFG_DEBUG_APP_TRACE != 0 )
381
414
#define APP_DBG_MSG PRINT_MESG_DBG
@@ -431,18 +464,12 @@ typedef enum
431
464
#define MAX_DBG_TRACE_MSG_SIZE 1024
432
465
433
466
/* USER CODE BEGIN Defines */
434
- #define CFG_LED_SUPPORTED 0
467
+ #define CFG_LED_SUPPORTED 1
435
468
#define CFG_BUTTON_SUPPORTED 1
436
469
437
- #ifdef LITTLE_DORY
438
- #define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI0_IRQHandler
439
- #define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI4_IRQHandler
440
- #define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI9_5_IRQHandler
441
- #else
442
- #define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
443
- #define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
444
- #define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
445
- #endif
470
+ #define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler
471
+ #define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler
472
+ #define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler
446
473
/* USER CODE END Defines */
447
474
448
475
/******************************************************************************
@@ -459,8 +486,7 @@ typedef enum
459
486
/**< Add in that list all tasks that may send a ACI/HCI command */
460
487
typedef enum
461
488
{
462
- CFG_TASK_ADV_UPDATE_ID ,
463
- CFG_TASK_MEAS_REQ_ID ,
489
+ CFG_TASK_BEACON_UPDATE_REQ_ID ,
464
490
CFG_TASK_HCI_ASYNCH_EVT_ID ,
465
491
/* USER CODE BEGIN CFG_Task_Id_With_HCI_Cmd_t */
466
492
0 commit comments