Skip to content

Commit b7ceee3

Browse files
committed
Update v1.4.x nimble core to esp-nimble 1.5.0
1 parent e46123a commit b7ceee3

File tree

223 files changed

+29367
-13437
lines changed

Some content is hidden

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

223 files changed

+29367
-13437
lines changed

src/NimBLEDevice.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,19 +866,23 @@ void NimBLEDevice::init(const std::string &deviceName) {
866866

867867
esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
868868

869+
# if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
869870
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
870-
#if defined (CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
871+
# if defined (CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
871872
bt_cfg.bluetooth_mode = ESP_BT_MODE_BLE;
872-
#else
873+
# else
873874
bt_cfg.mode = ESP_BT_MODE_BLE;
874875
bt_cfg.ble_max_conn = CONFIG_BT_NIMBLE_MAX_CONNECTIONS;
875-
#endif
876+
# endif
877+
878+
# ifdef CONFIG_BTDM_BLE_SCAN_DUPL
876879
bt_cfg.normal_adv_size = m_scanDuplicateSize;
877880
bt_cfg.scan_duplicate_type = m_scanFilterMode;
878-
881+
# endif
879882
ESP_ERROR_CHECK(esp_bt_controller_init(&bt_cfg));
880883
ESP_ERROR_CHECK(esp_bt_controller_enable(ESP_BT_MODE_BLE));
881884
ESP_ERROR_CHECK(esp_nimble_hci_init());
885+
# endif
882886
#endif
883887
nimble_port_init();
884888

@@ -925,10 +929,12 @@ void NimBLEDevice::deinit(bool clearAll) {
925929
if (ret == 0) {
926930
nimble_port_deinit();
927931
#ifdef ESP_PLATFORM
932+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
928933
ret = esp_nimble_hci_and_controller_deinit();
929934
if (ret != ESP_OK) {
930935
NIMBLE_LOGE(LOG_TAG, "esp_nimble_hci_and_controller_deinit() failed with error: %d", ret);
931936
}
937+
#endif
932938
#endif
933939
initialized = false;
934940
m_synced = false;

src/nimble/NOTICE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Apache Mynewt NimBLE
2-
Copyright 2015-2020 The Apache Software Foundation
3-
Modifications Copyright 2017-2020 Espressif Systems (Shanghai) CO., LTD.
2+
Copyright 2015-2022 The Apache Software Foundation
3+
Modifications Copyright 2017-2022 Espressif Systems (Shanghai) CO., LTD.
44

55
This product includes software developed at
66
The Apache Software Foundation (http://www.apache.org/).

src/nimble/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,24 @@
1919
#
2020
-->
2121

22+
2223
<img src="http://mynewt.apache.org/img/logo.svg" width="250" alt="Apache Mynewt">
2324

25+
2426
## Overview
2527

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

30-
Features highlight:
31-
- Support for 251 byte packet size
32+
Feature highlight:
33+
- Support for 251 byte packet size.
3234
- Support for all 4 roles concurrently - Broadcaster, Observer, Peripheral and Central
3335
- Support for up to 32 simultaneous connections.
3436
- Legacy and SC (secure connections) SMP support (pairing and bonding).
3537
- Advertising Extensions.
3638
- Periodic Advertising.
37-
- Coded (aka Long Range) and 2M PHYs.
39+
- Coded (a.k.a. Long Range) and 2M PHYs.
3840
- Bluetooth Mesh.
3941

4042
## Supported hardware

src/nimble/RELEASE_NOTES.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
# RELEASE NOTES
22

3-
24 March 2021 - Apache NimBLE v1.4.0
3+
20 April 2022 - Apache NimBLE v1.5.0
44

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

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

1111
New features in this version of NimBLE include:
1212

13-
* Support for PHY on Dialog Configurable MAC (CMAC)
14-
* Support for PHY on Nordic nRF5340
15-
* Support for Apache NuttX port of NimBLE
16-
* Controller-to-host flow control support
17-
* Support for USB transport
18-
* Various bugfixes
13+
* Fake dual-mode option for controller
14+
* LLCP tracing via HCI events
15+
* Code size optimization for disabled GAP roles
16+
* Support for PA/LNA
17+
* LE Secure Connections Only mode
18+
* Support for Bluetooth Core Specification 5.3
19+
* Connection subrating
20+
* BabbleSim support
21+
* Various bugfixes and improvements
1922

2023
If working on next-generation RTOS and Bluetooth protocol stack
2124
sounds exciting to you, get in touch, by sending a mail to the Apache Mynewt

src/nimble/esp_port/esp-hci/include/esp_nimble_hci.h

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#ifdef ESP_PLATFORM
87
#ifndef __ESP_NIMBLE_HCI_H__
98
#define __ESP_NIMBLE_HCI_H__
109

11-
#include "nimble/nimble/include/nimble/ble_hci_trans.h"
10+
#include "nimble/nimble/transport/include/nimble/transport.h"
1211

1312
#ifdef __cplusplus
1413
extern "C" {
@@ -34,46 +33,6 @@ extern "C" {
3433
*/
3534
esp_err_t esp_nimble_hci_init(void);
3635

37-
/**
38-
* @brief Initialize ESP Bluetooth controller(link layer) and VHCI transport
39-
* layer between NimBLE Host and ESP Bluetooth controller
40-
*
41-
* This function initializes ESP controller in BLE only mode and the
42-
* transport buffers to be exchanged between NimBLE host and ESP controller.
43-
* It also registers required host callbacks with the controller.
44-
*
45-
* Below is the sequence of APIs to be called to init/enable NimBLE host and ESP controller:
46-
*
47-
* @code{c}
48-
* void ble_host_task(void *param)
49-
* {
50-
* nimble_port_run(); //This function will return only when nimble_port_stop() is executed.
51-
* nimble_port_freertos_deinit();
52-
* }
53-
*
54-
* int ret = esp_nimble_hci_and_controller_init();
55-
* if (ret != ESP_OK) {
56-
ESP_LOGE(TAG, "esp_nimble_hci_and_controller_init() failed with error: %d", ret);
57-
* return;
58-
* }
59-
*
60-
* nimble_port_init();
61-
*
62-
* //Initialize the NimBLE Host configuration
63-
*
64-
* nimble_port_freertos_init(ble_host_task);
65-
* @endcode
66-
*
67-
* nimble_port_freertos_init() is an optional call that creates a new task in which the NimBLE
68-
* host will run. The task function should have a call to nimble_port_run(). If a separate task
69-
* is not required, calling nimble_port_run() will run the NimBLE host in the current task.
70-
*
71-
* @return
72-
* - ESP_OK if the initialization is successful
73-
* - Appropriate error code from esp_err_t in case of an error
74-
*/
75-
esp_err_t esp_nimble_hci_and_controller_init(void);
76-
7736
/**
7837
* @brief Deinitialize VHCI transport layer between NimBLE Host and
7938
* ESP Bluetooth controller
@@ -86,40 +45,8 @@ esp_err_t esp_nimble_hci_and_controller_init(void);
8645
*/
8746
esp_err_t esp_nimble_hci_deinit(void);
8847

89-
/**
90-
* @brief Deinitialize VHCI transport layer between NimBLE Host and
91-
* ESP Bluetooth controller and disable and deinitialize the controller
92-
*
93-
* @note This function should not be executed in the context of Bluetooth host task.
94-
*
95-
* @note This function should be called after the NimBLE host is deinitialized.
96-
*
97-
* Below is the sequence of APIs to be called to disable/deinit NimBLE host and ESP controller:
98-
*
99-
* @code{c}
100-
* int ret = nimble_port_stop();
101-
* if (ret == 0) {
102-
* nimble_port_deinit();
103-
*
104-
* ret = esp_nimble_hci_and_controller_deinit();
105-
* if (ret != ESP_OK) {
106-
ESP_LOGE(TAG, "esp_nimble_hci_and_controller_deinit() failed with error: %d", ret);
107-
* }
108-
* }
109-
* @endcode
110-
*
111-
* If nimble_port_freertos_init() is used during initialization, then
112-
* nimble_port_freertos_deinit() should be called in the host task after nimble_port_run().
113-
*
114-
* @return
115-
* - ESP_OK if the deinitialization is successful
116-
* - Appropriate error codes from esp_err_t in case of an error
117-
*/
118-
esp_err_t esp_nimble_hci_and_controller_deinit(void);
119-
12048
#ifdef __cplusplus
12149
}
12250
#endif
12351

12452
#endif /* __ESP_NIMBLE_HCI_H__ */
125-
#endif

0 commit comments

Comments
 (0)