Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,13 @@ jobs:
[env]
platform = espressif32
framework = arduino
build_flags = -D MYNEWT_VAL_BLE_EXT_ADV=1

[env:esp32c3]
board = esp32-c3-devkitm-1
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'

[env:esp32s3]
board = esp32-s3-devkitc-1
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
EOF
cp ${{ matrix.example }}/* example/src/
platformio run -d example
Expand Down Expand Up @@ -160,22 +159,19 @@ jobs:
[env]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
framework = arduino
build_flags = -D MYNEWT_VAL_BLE_EXT_ADV=1

[env:esp32c3]
board = esp32-c3-devkitm-1
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'

[env:esp32s3]
board = esp32-s3-devkitc-1
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'

[env:esp32c6]
board = esp32-c6-devkitc-1
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'

[env:esp32h2]
board = esp32-h2-devkitm-1
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
EOF
cp ${{ matrix.example }}/* example/src/
platformio run -d example
Expand Down Expand Up @@ -224,7 +220,7 @@ jobs:
- uses: actions/checkout@v4
- name: Set config for BT5
run: |
sed -i '0,/#include \"nimconfig_rename.h\"/a #define CONFIG_BT_NIMBLE_EXT_ADV 1' ./src/nimconfig.h
sed -i 's|^// \(#define MYNEWT_VAL_BLE_EXT_ADV 1\)|\1|' ./src/nimconfig.h
- name: Build BT5 arduino-esp32
uses: arduino/[email protected]
with:
Expand All @@ -244,7 +240,7 @@ jobs:
- "examples/NimBLE_Client"
- "examples/NimBLE_Server"
variant:
- Generic_nRF51822:chip=xxaa
# - Generic_nRF51822:chip=xxaa
- Generic_nRF52832
- Generic_nRF52833
- Generic_nRF52840
Expand Down Expand Up @@ -276,7 +272,7 @@ jobs:
- uses: actions/checkout@v4
- name: Set config for BT5
run: |
echo "-DCONFIG_BT_NIMBLE_EXT_ADV=1" > ${{ matrix.example }}/build_opt.h
echo "-DMYNEWT_VAL_BLE_EXT_ADV=1" > ${{ matrix.example }}/build_opt.h
- name: Build BT5 n-able Arduino
uses: arduino/[email protected]
with:
Expand Down Expand Up @@ -313,11 +309,11 @@ jobs:
mkdir example/src
cat > example/platformio.ini << EOF
[env]
platform = https://github.com/h2zero/platform-n-able.git#1.1.1
platform = https://github.com/h2zero/platform-n-able.git
framework = arduino

[env:generic_nrf51822_xxaa
board = generic_nrf51822_xxaa
; [env:generic_nrf51822_xxaa
; board = generic_nrf51822_xxaa

[env:generic_nrf52832]
board = generic_nrf52832
Expand Down Expand Up @@ -356,12 +352,12 @@ jobs:
mkdir example/src
cat > example/platformio.ini << EOF
[env]
platform = https://github.com/h2zero/platform-n-able.git#1.1.1
platform = https://github.com/h2zero/platform-n-able.git
framework = arduino

[env:generic_nrf52840]
board = generic_nrf52840
build_flags = '-DCONFIG_BT_NIMBLE_EXT_ADV=1'
build_flags = '-DMYNEWT_VAL_BLE_EXT_ADV=1'
EOF
cp ${{ matrix.example }}/* example/src/
platformio run -d example
Expand Down
232 changes: 95 additions & 137 deletions docs/Command_line_config.md
Original file line number Diff line number Diff line change
@@ -1,173 +1,131 @@
# Arduino command line and platformio config options
# Arduino command line and platformio config options

`CONFIG_BT_NIMBLE_MAX_CONNECTIONS`
Below are the configuration macros for NimBLE-Arduino, updated and reordered to match those found in `nimconfig.h`.
Uncomment or define these in your build system or `sdkconfig.h`/`platformio.ini` as needed.

Sets the number of simultaneous connections (esp controller max is 9)
- Default value is 3
<br/>
---

`CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED`

Enable/disable storing the timestamp when an attribute value is updated
This allows for checking the last update time using getTimeStamp() or getValue(time_t*)
If disabled, the timestamp returned from these functions will be 0.
Disabling timestamps will reduce the memory used for each value.
1 = Enabled, 0 = Disabled; Default = Disabled
<br/>

`CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH`

Set the default allocation size (bytes) for each attribute.
If not specified when the constructor is called. This is also the size used when a remote
characteristic or descriptor is constructed before a value is read/notifed.
Increasing this will reduce reallocations but increase memory footprint.
Default value is 20. Range: 1 : 512 (BLE_ATT_ATTR_MAX_LEN)
<br/>

`CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU`
`MYNEWT_VAL_BLE_MAX_CONNECTIONS`
Sets the number of simultaneous BLE connections (ESP32 controller max is 9)
- Default: 3

`MYNEWT_VAL_BLE_ATT_PREFERRED_MTU`
Sets the default MTU size.
- Default value is 255
<br/>

`CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME`

Set the default device name
- Default value is "nimble"
<br/>

`CONFIG_BT_NIMBLE_DEBUG`

If defined, enables debug log messages from the NimBLE host
- Uses approx. 32kB of flash memory.
<br/>

`CONFIG_NIMBLE_CPP_LOG_LEVEL`

Define to set the debug log message level from the NimBLE CPP Wrapper.
If not defined it will use the same value as the Arduino core debug level.
Values: 0 = NONE, 1 = ERROR, 2 = WARNING, 3 = INFO, 4+ = DEBUG
<br/>

`CONFIG_NIMBLE_CPP_ENABLE_RETURN_CODE_TEXT`

If defined, NimBLE host return codes will be printed as text in debug log messages.
- Uses approx. 7kB of flash memory.
<br/>

`CONFIG_NIMBLE_CPP_ENABLE_GAP_EVENT_CODE_TEXT`

If defined, GAP event codes will be printed as text in debug log messages.
- Uses approx. 1kB of flash memory.
<br/>
- Default: 517

`CONFIG_NIMBLE_CPP_ENABLE_ADVERTISMENT_TYPE_TEXT`
`MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME`
Set the default BLE device name
- Default: "nimble"

If defined, advertisment types will be printed as text while scanning in debug log messages.
- Uses approx. 250 bytes of flash memory.
<br/>
`MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE`
Set the default GAP appearance
- Default: 0x0

`CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE`
`MYNEWT_VAL_BLE_HS_LOG_LVL`
Set the debug log messages level from the NimBLE host stack.
Values: 0 = DEBUG, 1 = INFO, 2 = WARNING, 3 = ERROR, 4 = CRITICAL, 5+ = NONE
- Default: 5

Set the default appearance.
- Default value is 0x00
<br/>
`MYNEWT_VAL_BLE_ROLE_CENTRAL`
If 0, NimBLE Client functions will not be included.
- Reduces flash size by approx. 7kB

`CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED`

If defined, NimBLE Client functions will not be included.
- Reduces flash size by approx. 7kB.
<br/>
`MYNEWT_VAL_BLE_ROLE_OBSERVER`
If 0, NimBLE Scan functions will not be included.
- Reduces flash size by approx. 26kB

`CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED`
`MYNEWT_VAL_BLE_ROLE_PERIPHERAL`
If 0, NimBLE Server functions will not be included.
- Reduces flash size by approx. 16kB

If defined, NimBLE Scan functions will not be included.
- Reduces flash size by approx. 26kB.
<br/>

`CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED`

If defined NimBLE Server functions will not be included.
- Reduces flash size by approx. 16kB.
<br/>

`CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED`

If defined, NimBLE Advertising functions will not be included.
- Reduces flash size by approx. 5kB.
<br/>

`CONFIG_BT_NIMBLE_MAX_BONDS`
`MYNEWT_VAL_BLE_ROLE_BROADCASTER`
If 0, NimBLE Advertising functions will not be included.
- Reduces flash size by approx. 5kB

`MYNEWT_VAL_BLE_STORE_MAX_BONDS`
Sets the number of devices allowed to store/bond with
- Default value is 3
<br/>

`CONFIG_BT_NIMBLE_MAX_CCCDS`
- Default: 3

`MYNEWT_VAL_BLE_STORE_MAX_CCCDS`
Sets the maximum number of CCCD subscriptions to store
- Default value is 8
<br/>
- Default: 8

`CONFIG_BT_NIMBLE_RPA_TIMEOUT`
`MYNEWT_VAL_BLE_RPA_TIMEOUT`
Sets the random address refresh time in seconds
- Default: 900

Sets the random address refresh time in seconds.
- Default value is 900
<br/>
`MYNEWT_VAL_MSYS_1_BLOCK_COUNT`
Set the number of msys blocks for prepare write & prepare responses
- Default: 12

`CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT`
`MYNEWT_VAL_NIMBLE_MEM_ALLOC_MODE_EXTERNAL`
Set to 1 to use external PSRAM for NimBLE host
- Default: 0 (internal)

Set the number of msys blocks For prepare write & prepare responses. This may need to be increased if
you are sending large blocks of data with a low MTU. E.g: 512 bytes with 23 MTU will fail.
- Default value is 12
<br/>
`MYNEWT_VAL_NIMBLE_PINNED_TO_CORE`
Sets the core the NimBLE host stack will run on
- Options: 0 or 1

`CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL`
`MYNEWT_VAL_NIMBLE_HOST_TASK_STACK_SIZE`
Set the task stack size for the NimBLE host
- Default: 4096

Sets the NimBLE stack to use external PSRAM will be loaded
- Must be defined with a value of 1; Default is CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL 1
<br/>
`MYNEWT_VAL_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT`
Set the bit used to block tasks during BLE operations
- Default: 31

`CONFIG_BT_NIMBLE_PINNED_TO_CORE`
`MYNEWT_VAL_NIMBLE_CPP_ADDR_FMT_EXCLUDE_DELIMITER`
Disable showing colon characters when printing address

Sets the core the NimBLE host stack will run on
- Options: 0 or 1
<br/>
`MYNEWT_VAL_NIMBLE_CPP_ADDR_FMT_UPPERCASE`
Use uppercase letters when printing address

`MYNEWT_VAL_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED`
Enable/disable storing the timestamp when an attribute value is updated
- 1 = Enabled, 0 = Disabled; Default = Disabled

`MYNEWT_VAL_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH`
Set the default allocation size (bytes) for each attribute
- Default: 20; Range: 1–512

`CONFIG_BT_NIMBLE_TASK_STACK_SIZE`
`MYNEWT_VAL_NIMBLE_CPP_LOG_LEVEL`
Set the debug log message level from the NimBLE CPP Wrapper
Values: 0 = NONE, 1 = ERROR, 2 = WARNING, 3 = INFO, 4+ = DEBUG
- Default: Uses Arduino core debug level

Set the task stack size for the NimBLE core.
- Default is 4096
<br/>
`MYNEWT_VAL_NIMBLE_CPP_DEBUG_ASSERT_ENABLED`
Enable debug asserts in NimBLE CPP wrapper
- Default: 0 (disabled)

### Extended advertising settings, For use with ESP32C3, ESP32S3, ESP32H2 ONLY!

`CONFIG_BT_NIMBLE_EXT_ADV`
`MYNEWT_VALNIMBLE_CPP_ENABLE_RETURN_CODE_TEXT`
If defined, NimBLE host return codes will be printed as text in debug log messages
- Uses approx. 7kB of flash memory

Set to 1 to enable extended advertising features.
<br/>
`MYNEWT_VAL_NIMBLE_CPP_ENABLE_GAP_EVENT_CODE_TEXT`
If defined, GAP event codes will be printed as text in debug log messages
- Uses approx. 1kB of flash memory

`CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES`
`MYNEWT_VAL_NIMBLE_CPP_ENABLE_ADVERTISEMENT_TYPE_TEXT`
If defined, advertisement types will be printed as text while scanning in debug log messages
- Uses approx. 250 bytes of flash memory

Sets the max number of extended advertising instances
- Range: 0 - 4
- Default is 1
<br/>
---

`CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN`
## Extended advertising settings (ESP32C3, ESP32S3, ESP32H2 ONLY)

Set the max extended advertising data size,
- Range: 31 - 1650
- Default is 255
<br/>
`MYNEWT_VAL_BLE_EXT_ADV`
Set to 1 to enable extended advertising features

`CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV`
`MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES`
Sets the max number of extended advertising instances
- Range: 0–4; Default: 0

Set to 1 to enable periodic advertising.
<br/>
`MYNEWT_VAL_BLE_EXT_ADV_MAX_SIZE`
Set the max extended advertising data size
- Range: 31–1650; Default: 1650

`CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS`
---

Set the maximum number of periodically synced devices.
- Range: 1 - 8
- Default is 1
**Note:**
All macro names and descriptions above are matched to those found in `nimconfig.h`.
Uncomment or define them in your build system as needed.
12 changes: 6 additions & 6 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2416,12 +2416,12 @@ INCLUDE_FILE_PATTERNS =
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED = _DOXYGEN_ \
CONFIG_BT_ENABLED \
CONFIG_BT_NIMBLE_ROLE_CENTRAL \
CONFIG_BT_NIMBLE_ROLE_OBSERVER \
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL \
CONFIG_BT_NIMBLE_ROLE_BROADCASTER \
CONFIG_BT_NIMBLE_EXT_ADV
CONFIG_BT_NIMBLE_ENABLED=1 \
MYNEWT_VAL_BLE_ROLE_CENTRAL=1 \
MYNEWT_VAL_BLE_ROLE_OBSERVER=1 \
MYNEWT_VAL_BLE_ROLE_PERIPHERAL=1 \
MYNEWT_VAL_BLE_ROLE_BROADCASTER=1 \
MYNEWT_VAL_BLE_EXT_ADV=1

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <Arduino.h>
#include <NimBLEDevice.h>
#if !CONFIG_BT_NIMBLE_EXT_ADV
#if !MYNEWT_VAL(BLE_EXT_ADV)
# error Must enable extended advertising, see nimconfig.h file.
#endif

Expand Down
Loading