Skip to content

Nimble core 1.6 #891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2025
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
18 changes: 8 additions & 10 deletions src/NimBLEDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extern "C" void ble_store_config_init(void);
/**
* Singletons for the NimBLEDevice.
*/
NimBLEDeviceCallbacks NimBLEDevice::defaultDeviceCallbacks{};
NimBLEDeviceCallbacks NimBLEDevice::defaultDeviceCallbacks{};
NimBLEDeviceCallbacks* NimBLEDevice::m_pDeviceCallbacks = &defaultDeviceCallbacks;

# if defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
Expand Down Expand Up @@ -476,14 +476,14 @@ bool NimBLEDevice::setPower(int8_t dbm, NimBLETxPowerType type) {
dbm++; // round up to the next multiple of 3 to be able to target 20dbm
}

bool success = false;
esp_power_level_t espPwr = static_cast<esp_power_level_t>(dbm / 3 + ESP_PWR_LVL_N0);
bool success = false;
esp_power_level_t espPwr = static_cast<esp_power_level_t>(dbm / 3 + ESP_PWR_LVL_N0);
if (type == NimBLETxPowerType::All) {
success = setPowerLevel(espPwr, ESP_BLE_PWR_TYPE_ADV);
success &= setPowerLevel(espPwr, ESP_BLE_PWR_TYPE_SCAN);
success &= setPowerLevel(espPwr, ESP_BLE_PWR_TYPE_DEFAULT);
} else if (type == NimBLETxPowerType::Advertise) {
success = setPowerLevel(espPwr, ESP_BLE_PWR_TYPE_ADV);
success = setPowerLevel(espPwr, ESP_BLE_PWR_TYPE_ADV);
} else if (type == NimBLETxPowerType::Scan) {
success = setPowerLevel(espPwr, ESP_BLE_PWR_TYPE_SCAN);
} else if (type == NimBLETxPowerType::Connection) {
Expand All @@ -495,15 +495,13 @@ bool NimBLEDevice::setPower(int8_t dbm, NimBLETxPowerType type) {
# else
(void)type; // unused
NIMBLE_LOGD(LOG_TAG, ">> setPower: %d", dbm);
ble_hci_vs_set_tx_pwr_cp cmd{dbm};
ble_hci_vs_set_tx_pwr_rp rsp{0};
int rc = ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_SET_TX_PWR, &cmd, sizeof(cmd), &rsp, sizeof(rsp));
int rc = ble_phy_tx_power_set(dbm);
if (rc) {
NIMBLE_LOGE(LOG_TAG, "failed to set TX power, rc: %04x\n", rc);
return false;
}

NIMBLE_LOGD(LOG_TAG, "TX power set to %d dBm\n", rsp.tx_power);
NIMBLE_LOGD(LOG_TAG, "TX power set to %d dBm\n", dbm);
return true;
# endif
} // setPower
Expand Down Expand Up @@ -539,7 +537,7 @@ int NimBLEDevice::getPower(NimBLETxPowerType type) {
# endif
# else
(void)type; // unused
return ble_phy_txpwr_get();
return ble_phy_tx_power_get();
# endif
} // getPower

Expand Down Expand Up @@ -844,7 +842,7 @@ bool NimBLEDevice::init(const std::string& deviceName) {
if (!m_initialized) {
# ifdef ESP_PLATFORM

# if defined(CONFIG_ENABLE_ARDUINO_DEPENDS) && SOC_BT_SUPPORTED
# if defined(CONFIG_ENABLE_ARDUINO_DEPENDS) && SOC_BT_SUPPORTED
// make sure the linker includes esp32-hal-bt.c so Arduino init doesn't release BLE memory.
btStarted();
# endif
Expand Down
10 changes: 10 additions & 0 deletions src/nimble/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,13 @@ under the following license:
This product bundles tinycrypt, which is available under the "3-clause BSD"
license. For details, and bundled files see:
* ext/tinycrypt/LICENSE

This product bundles and partly derives from parts of the Nordic nRF52 SDK,
which are available under a BSD style license. Relevant files are:
* babblesim/hw/mcu/nordic/nrf52_bsim/src/system_nrf52.c

This product bundles additional files from CMSIS-CORE, but these files are
missing licensing information. The BSD license was subsequently added to
these files in later releases. These files are:
* babblesim/hw/mcu/nordic/nrf52_bsim/include/mcu/cmsis_nvic.h

34 changes: 29 additions & 5 deletions src/nimble/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,21 @@

## Overview

Apache NimBLE is an open-source Bluetooth 5.1 stack (both Host & Controller)
<a href="https://github.com/apache/mynewt-nimble/actions/workflows/build_targets.yml">
<img src="https://github.com/apache/mynewt-nimble/actions/workflows/build_targets.yml/badge.svg">
<a/>

<a href="https://github.com/apache/mynewt-nimble/actions/workflows/build_ports.yml">
<img src="https://github.com/apache/mynewt-nimble/actions/workflows/build_ports.yml/badge.svg">
<a/>

<a href="https://github.com/apache/mynewt-nimble/actions/workflows/newt_test_all.yml/badge.svg">
<img src="https://github.com/apache/mynewt-nimble/actions/workflows/newt_test_all.yml/badge.svg">
<a/>

<p>

Apache NimBLE is an open-source Bluetooth 5.4 stack (both Host & Controller)
that completely replaces the proprietary SoftDevice on Nordic chipsets. It is
part of [Apache Mynewt project](https://github.com/apache/mynewt-core).

Expand All @@ -41,9 +55,9 @@ Feature highlight:

## Supported hardware

Controller supports Nordic nRF51 and nRF52 chipsets. Host runs on any board
and architecture [supported](https://github.com/apache/mynewt-core#overview)
by Apache Mynewt OS.
Controller supports Nordic nRF51, nRF52 and nRF5340 chipsets as well as DA1469x (cmac)
from Renesas. Host runs on any board and architecture
[supported](https://github.com/apache/mynewt-core#overview) by Apache Mynewt OS.


## Browsing
Expand Down Expand Up @@ -105,6 +119,16 @@ Implements a simple BLE peripheral that supports the Nordic
UART / Serial Port Emulation service
(https://developer.nordicsemi.com/nRF5_SDK/nRF51_SDK_v8.x.x/doc/8.0.0/s110/html/a00072.html).

## External projects using NimBLE

Several other projects provide support for using NimBLE either by [NPL port](https://github.com/apache/mynewt-nimble/tree/master/porting) or forking:

* [The Espressif ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/nimble/index.html) contains a NimBLE port for ESP-32 devices.
* [The RIOT](https://doc.riot-os.org/group__pkg__nimble.html) operating system contains a package for using NimBLE.
* [The Open IOT SDK](https://gitlab.arm.com/iot/open-iot-sdk/sdk) contains a NimBLE [port](https://gitlab.arm.com/iot/open-iot-sdk/sdk/-/tree/main/components/bluetooth) based on [CMSIS RTOSv2](https://www.keil.com/pack/doc/CMSIS/RTOS2/html/index.html), which is an RTOS interface implemented by either Amazon Freertos, CMSIS RTX or Azure ThreadX.

If you publish a NimBLE port, please let us know to include it here!

# Getting Help

If you are having trouble using or contributing to Apache Mynewt NimBLE, or just
Expand All @@ -114,7 +138,7 @@ want to talk to a human about what you're working on, you can contact us via the
Although not a formal channel, you can also find a number of core developers
on the #mynewt channel on Freenode IRC or #general channel on [Mynewt Slack](https://mynewt.slack.com/join/shared_invite/enQtNjA1MTg0NzgyNzg3LTcyMmZiOGQzOGMxM2U4ODFmMTIwNjNmYTE5Y2UwYjQwZWIxNTE0MTUzY2JmMTEzOWFjYWZkNGM0YmM4MzAxNWQ)

Also, be sure to checkout the [Frequently Asked Questions](https://mynewt.apache.org/faq/answers)
Also, be sure to checkout the [Frequently Asked Questions](https://mynewt.apache.org/latest/mynewt_faq)
for some help troubleshooting first.

# Contributing
Expand Down
18 changes: 7 additions & 11 deletions src/nimble/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# RELEASE NOTES

20 April 2022 - Apache NimBLE v1.5.0
09 August 2023 - Apache NimBLE v1.6.0

For full release notes, please visit the
[Apache Mynewt Wiki](https://cwiki.apache.org/confluence/display/MYNEWT/Release+Notes).

Apache NimBLE is an open-source Bluetooth 5.3 stack (both Host & Controller) that completely
Apache NimBLE is an open-source Bluetooth 5.4 stack (both Host & Controller) that completely
replaces the proprietary SoftDevice on Nordic chipsets.

New features in this version of NimBLE include:

* Fake dual-mode option for controller
* LLCP tracing via HCI events
* Code size optimization for disabled GAP roles
* Support for PA/LNA
* LE Secure Connections Only mode
* Support for Bluetooth Core Specification 5.3
* Connection subrating
* BabbleSim support
* Various bugfixes and improvements
* Initial support for ISO broacaster
* Support for Bluetooth Core Specification 5.4
* FEM antenna control
* nRF PHY driver unification
* IPC HCI transport improvements

If working on next-generation RTOS and Bluetooth protocol stack
sounds exciting to you, get in touch, by sending a mail to the Apache Mynewt
Expand Down
59 changes: 0 additions & 59 deletions src/nimble/esp_port/esp-hci/include/esp_compiler.h

This file was deleted.

Loading