BSB Developer Docs
Loading...
Searching...
No Matches
ble_config.h
1/*******************************************************************************
2* @file ble_config.h
3* @brief
4*******************************************************************************
5* # License
6* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
7*******************************************************************************
8*
9* The licensor of this software is Silicon Laboratories Inc. Your use of this
10* software is governed by the terms of Silicon Labs Master Software License
11* Agreement (MSLA) available at
12* www.silabs.com/about-us/legal/master-software-license-agreement. This
13* software is distributed to you in Source Code format and is governed by the
14* sections of the MSLA applicable to Source Code.
15*
16******************************************************************************/
17
18#ifndef BLE_CONFIG_H
19#define BLE_CONFIG_H
20
21/******************************************************
22 * * Macros
23 * ******************************************************/
24#define RSI_BLE_SET_RAND_ADDR "00:23:A7:12:34:56"
25
26#define CLEAR_ACCEPTLIST 0x00
27#define ADD_DEVICE_TO_ACCEPTLIST 0x01
28#define DELETE_DEVICE_FROM_ACCEPTLIST 0x02
29
30#define ALL_PHYS 0x00
31
32#define RSI_BLE_DEV_ADDR_RESOLUTION_ENABLE 0
33
34#define RSI_OPERMODE_WLAN_BLE 13
35
36#ifdef SLI_SI91X_MCU_INTERFACE
37#define RSI_BLE_MAX_NBR_ATT_REC 80
38/* Number of BLE notifications */
39#define RSI_BLE_NUM_CONN_EVENTS 20
40#define RSI_BLE_MAX_NBR_PERIPHERALS 1
41#define RSI_BLE_MAX_NBR_CENTRALS 1
42#else
43#define RSI_BLE_MAX_NBR_ATT_REC 80
44/* Number of BLE notifications */
45#define RSI_BLE_NUM_CONN_EVENTS 20
46#define RSI_BLE_MAX_NBR_PERIPHERALS 3
47#define RSI_BLE_MAX_NBR_CENTRALS 1
48#endif
49
50#define RSI_BLE_MAX_NBR_ATT_SERV 10
51#define RSI_BLE_MAX_NBR_CENTRALS 1
52#define RSI_BLE_GATT_ASYNC_ENABLE 1
53#define RSI_BLE_GATT_INIT 0
54
55/* Number of BLE GATT RECORD SIZE IN (n*16 BYTES), eg:(0x60*16)=1536 bytes */
56#define RSI_BLE_NUM_REC_BYTES 0x60
57
58#define RSI_BLE_INDICATE_CONFIRMATION_FROM_HOST 1
59
60/*=======================================================================*/
62/*=======================================================================*/
63
64#define RSI_BLE_ADV_TYPE UNDIR_CONN
65#define RSI_BLE_ADV_FILTER_TYPE ALLOW_SCAN_REQ_ANY_CONN_REQ_ANY
66#define RSI_BLE_ADV_DIR_ADDR_TYPE LE_PUBLIC_ADDRESS
67#define RSI_BLE_ADV_DIR_ADDR "00:15:83:6A:64:17"
68
69#define RSI_BLE_ADV_INT_MIN 0x100
70#define RSI_BLE_ADV_INT_MAX 0x200
71#define RSI_BLE_ADV_CHANNEL_MAP 0x07
72
75#define RSI_BLE_START_ADV 0x01
77#define RSI_BLE_STOP_ADV 0x00
78
80#define RSI_BLE_PWR_INX 30
81
83#define BLE_DISABLE_DUTY_CYCLING 0
84#define BLE_DUTY_CYCLING 1
85#define BLR_DUTY_CYCLING 2
86#define BLE_4X_PWR_SAVE_MODE 4
87#define RSI_BLE_PWR_SAVE_OPTIONS BLE_DISABLE_DUTY_CYCLING
88
90
91/* Advertising will be visible(discoverable) to all the devices.
92 * Scanning/Connection is also accepted from all devices
93 * */
94#define UNDIR_CONN 0x80
95
96/* Advertising will be visible(discoverable) to the particular device
97 * mentioned in RSI_BLE_ADV_DIR_ADDR only.
98 * Scanning and Connection will be accepted from that device only.
99 * */
100#define DIR_CONN 0x81
101
102/* Advertising will be visible(discoverable) to all the devices.
103 * Scanning will be accepted from all the devices.
104 * Connection will be not be accepted from any device.
105 * */
106#define UNDIR_SCAN 0x82
107
108/* Advertising will be visible(discoverable) to all the devices.
109 * Scanning and Connection will not be accepted from any device
110 * */
111#define UNDIR_NON_CONN 0x83
112
113/* Advertising will be visible(discoverable) to the particular device
114 * mentioned in RSI_BLE_ADV_DIR_ADDR only.
115 * Scanning and Connection will be accepted from that device only.
116 * */
117#define DIR_CONN_LOW_DUTY_CYCLE 0x84
118
120#define LE_LIMITED_DISCOVERABLE 0x01
121#define LE_GENERAL_DISCOVERABLE 0x02
122#define LE_BR_EDR_NOT_SUPPORTED 0x04
123
125#define ALLOW_SCAN_REQ_ANY_CONN_REQ_ANY 0x00
126#define ALLOW_SCAN_REQ_ACCEPT_LIST_CONN_REQ_ANY 0x01
127#define ALLOW_SCAN_REQ_ANY_CONN_REQ_ACCEPT_LIST 0x02
128#define ALLOW_SCAN_REQ_ACCEPT_LIST_CONN_REQ_ACCEPT_LIST 0x03
129
131#define LE_PUBLIC_ADDRESS 0x00
132#define LE_RANDOM_ADDRESS 0x01
133#define LE_RESOLVABLE_PUBLIC_ADDRESS 0x02
134#define LE_RESOLVABLE_RANDOM_ADDRESS 0x03
135
136/*=======================================================================*/
137
138/*=======================================================================*/
140/*=======================================================================*/
141#define LE_SCAN_INTERVAL 0x0100
142#define LE_SCAN_WINDOW 0x0050
143
144#define CONNECTION_INTERVAL_MIN 0x00A0
145#define CONNECTION_INTERVAL_MAX 0x00A0
146
147#define CONNECTION_LATENCY 0x0000
148#define SUPERVISION_TIMEOUT 0x07D0 //2000
149
150/*=======================================================================*/
151
152/*=======================================================================*/
154/*=======================================================================*/
155
156#define RSI_BLE_SCAN_TYPE SCAN_TYPE_ACTIVE
157#define RSI_BLE_SCAN_FILTER_TYPE SCAN_FILTER_TYPE_ALL
158
160#define RSI_BLE_START_SCAN 0x01
161#define RSI_BLE_STOP_SCAN 0x00
162
164#define SCAN_TYPE_ACTIVE 0x01
165#define SCAN_TYPE_PASSIVE 0x00
166
168#define SCAN_FILTER_TYPE_ALL 0x00
169#define SCAN_FILTER_TYPE_ONLY_ACCEPT_LIST 0x01
170
171#define RSI_SEL_INTERNAL_ANTENNA 0x00
172#define RSI_SEL_EXTERNAL_ANTENNA 0x01
173
174/*=======================================================================*/
175
177#define RSI_BLE_REMOTE_DEV_ADDR "00:12:45:AB:1D:32"
179#define RSI_REMOTE_DEVICE_NAME "Note10"
180
182#define CONN_INTERVAL_MIN 0x08
183#define CONN_INTERVAL_MAX 0x08
184#define CONN_LATENCY 0
185
187#define SMP_ENABLE 0
188
190#define TX_LEN 0xFB
191#define TX_TIME 0x4290
192
193// DATA RATE
194// 0x02 - 2Mbps
195// 0x01 - 1Mbps
196// 0x04 - Coded PHY (set desired CODDED_PHY_RATE)
198#define TX_PHY_RATE 0x02
199#define RX_PHY_RATE 0x02
200// CODED_PHY_RATE: 0x01 - 500Kbps
201// CODED_PHY_RATE: 0x02 - 125Kbps
202#define CODDED_PHY_RATE 0x00
203
205#define NOTIFY_DISABLE 0x00
206#define NOTIFY_ENABLE 0x01
207
208#define DLE_ON 1
209
210#if DLE_ON
211#define DLE_BUFFER_MODE 1
212#define DLE_BUFFER_COUNT 10 // Should be less than RSI_BLE_NUM_CONN_EVENTS
213#define RSI_BLE_MAX_DATA_LEN RSI_DEV_ATT_LEN
214#else
215#define DLE_BUFFER_MODE 0
216#define DLE_BUFFER_COUNT 2 // Should be less than RSI_BLE_NUM_CONN_EVENTS
217#define RSI_BLE_MAX_DATA_LEN 20
218#endif
219
220#define BLE_SIMPLE_GATT 1
221/*=======================================================================*/
222// Extended Advertising parameters
223/*=======================================================================*/
224#define RSI_BLE_ENABLE_ADV_EXTN 1
225
226// default number of Advertising sets in extended advertising (Max value = 15)
227#define RSI_BLE_AE_MAX_ADV_SETS 1
228
229#endif