Skip to content

Commit be0dc22

Browse files
committed
Config rework - WIP
1 parent 5aaade0 commit be0dc22

File tree

191 files changed

+2354
-4757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+2354
-4757
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,13 @@ jobs:
7575
[env]
7676
platform = espressif32
7777
framework = arduino
78+
build_flags = -D MYNEWT_VAL_BLE_EXT_ADV=1
7879
7980
[env:esp32c3]
8081
board = esp32-c3-devkitm-1
81-
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
8282
8383
[env:esp32s3]
8484
board = esp32-s3-devkitc-1
85-
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
8685
EOF
8786
cp ${{ matrix.example }}/* example/src/
8887
platformio run -d example
@@ -160,22 +159,19 @@ jobs:
160159
[env]
161160
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
162161
framework = arduino
162+
build_flags = -D MYNEWT_VAL_BLE_EXT_ADV=1
163163
164164
[env:esp32c3]
165165
board = esp32-c3-devkitm-1
166-
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
167166
168167
[env:esp32s3]
169168
board = esp32-s3-devkitc-1
170-
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
171169
172170
[env:esp32c6]
173171
board = esp32-c6-devkitc-1
174-
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
175172
176173
[env:esp32h2]
177174
board = esp32-h2-devkitm-1
178-
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
179175
EOF
180176
cp ${{ matrix.example }}/* example/src/
181177
platformio run -d example
@@ -224,7 +220,7 @@ jobs:
224220
- uses: actions/checkout@v4
225221
- name: Set config for BT5
226222
run: |
227-
sed -i '0,/#include \"nimconfig_rename.h\"/a #define CONFIG_BT_NIMBLE_EXT_ADV 1' ./src/nimconfig.h
223+
sed -i 's|^// \(#define MYNEWT_VAL_BLE_EXT_ADV 1\)|\1|' ./src/nimconfig.h
228224
- name: Build BT5 arduino-esp32
229225
uses: arduino/[email protected]
230226
with:
@@ -276,7 +272,7 @@ jobs:
276272
- uses: actions/checkout@v4
277273
- name: Set config for BT5
278274
run: |
279-
echo "-DCONFIG_BT_NIMBLE_EXT_ADV=1" > ${{ matrix.example }}/build_opt.h
275+
echo "-DMYNEWT_VAL_BLE_EXT_ADV=1" > ${{ matrix.example }}/build_opt.h
280276
- name: Build BT5 n-able Arduino
281277
uses: arduino/[email protected]
282278
with:

docs/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ INCLUDE_FILE_PATTERNS =
24162416
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
24172417

24182418
PREDEFINED = _DOXYGEN_ \
2419-
CONFIG_BT_ENABLED \
2419+
CONFIG_BT_NIMBLE_ENABLED \
24202420
CONFIG_BT_NIMBLE_ROLE_CENTRAL \
24212421
CONFIG_BT_NIMBLE_ROLE_OBSERVER \
24222422
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL \

examples/Bluetooth_5/NimBLE_extended_client/NimBLE_extended_client.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <Arduino.h>
1212
#include <NimBLEDevice.h>
13-
#if !CONFIG_BT_NIMBLE_EXT_ADV
13+
#if !MYNEWT_VAL(BLE_EXT_ADV)
1414
# error Must enable extended advertising, see nimconfig.h file.
1515
#endif
1616

examples/Bluetooth_5/NimBLE_extended_scan/NimBLE_extended_scan.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <Arduino.h>
1111
#include <NimBLEDevice.h>
12-
#if !CONFIG_BT_NIMBLE_EXT_ADV
12+
#if !MYNEWT_VAL(BLE_EXT_ADV)
1313
# error Must enable extended advertising, see nimconfig.h file.
1414
#endif
1515

examples/Bluetooth_5/NimBLE_extended_server/NimBLE_extended_server.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <Arduino.h>
1616
#include <NimBLEDevice.h>
17-
#if !CONFIG_BT_NIMBLE_EXT_ADV
17+
#if !MYNEWT_VAL(BLE_EXT_ADV)
1818
# error Must enable extended advertising, see nimconfig.h file.
1919
#endif
2020

examples/Bluetooth_5/NimBLE_multi_advertiser/NimBLE_multi_advertiser.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <Arduino.h>
1616
#include <NimBLEDevice.h>
17-
#if !CONFIG_BT_NIMBLE_EXT_ADV
17+
#if !MYNEWT_VAL(BLE_EXT_ADV)
1818
# error Must enable extended advertising, see nimconfig.h file.
1919
#endif
2020

examples/L2CAP/L2CAP_Client/L2CAP_Client.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#include <Arduino.h>
66
#include <NimBLEDevice.h>
77

8-
#if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM <= 0
9-
# error "CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM must be set to 1 or greater"
8+
#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) < 1
9+
# error "MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM must be set to 1 or greater"
1010
#endif
1111

1212
// See the following for generating UUIDs:

examples/NimBLE_Client/NimBLE_Client.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ bool connectToServer() {
113113

114114
/** No client to reuse? Create a new one. */
115115
if (!pClient) {
116-
if (NimBLEDevice::getCreatedClientCount() >= NIMBLE_MAX_CONNECTIONS) {
116+
if (NimBLEDevice::getCreatedClientCount() >= MYNEWT_VAL(BLE_MAX_CONNECTIONS)) {
117117
Serial.printf("Max clients reached - no more connections available\n");
118118
return false;
119119
}

src/NimBLE2904.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#include "NimBLE2904.h"
19-
#if CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
19+
#if CONFIG_BT_NIMBLE_ENABLED && MYNEWT_VAL(BLE_ROLE_PERIPHERAL)
2020

2121
NimBLE2904::NimBLE2904(NimBLECharacteristic* pChr)
2222
: NimBLEDescriptor(NimBLEUUID((uint16_t)0x2904), BLE_GATT_CHR_F_READ, sizeof(NimBLE2904Data), pChr) {
@@ -69,4 +69,4 @@ void NimBLE2904::setUnit(uint16_t unit) {
6969
setValue(m_data);
7070
} // setUnit
7171

72-
#endif // CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
72+
#endif // CONFIG_BT_NIMBLE_ENABLED && MYNEWT_VAL(BLE_ROLE_PERIPHERAL)

src/NimBLE2904.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#ifndef NIMBLE_CPP_2904_H_
1919
#define NIMBLE_CPP_2904_H_
2020

21-
#include "nimconfig.h"
22-
#if CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
21+
#include "syscfg/syscfg.h"
22+
#if CONFIG_BT_NIMBLE_ENABLED && MYNEWT_VAL(BLE_ROLE_PERIPHERAL)
2323

2424
# include "NimBLEDescriptor.h"
2525

@@ -79,5 +79,5 @@ class NimBLE2904 : public NimBLEDescriptor {
7979
NimBLE2904Data m_data{};
8080
}; // NimBLE2904
8181

82-
#endif // CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
82+
#endif // CONFIG_BT_NIMBLE_ENABLED && MYNEWT_VAL(BLE_ROLE_PERIPHERAL)
8383
#endif // NIMBLE_CPP_2904_H_

0 commit comments

Comments
 (0)