You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-7Lines changed: 1 addition & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ For Nordic devices, this library provides access to a completely open source and
31
31
* Open platformio.ini, a project configuration file located in the root of PlatformIO project.
32
32
* Add the following line to the lib_deps option of [env:] section:
33
33
```
34
-
h2zero/NimBLE-Arduino@^2.1.0
34
+
h2zero/NimBLE-Arduino
35
35
```
36
36
* Build a project, PlatformIO will automatically install dependencies.
37
37
@@ -56,15 +56,9 @@ Change the settings in the `src/nimconfig.h` file to customize NimBLE to your pr
56
56
such as increasing max connections, default is 3 for the esp32.
57
57
<br/>
58
58
59
-
# Development Status
60
-
This Library is tracking the esp-nimble repo, nimble-1.5.0-idf branch, currently [@e3cbdc0.](https://github.com/espressif/esp-nimble)
61
-
<br/>
62
-
63
59
# Sponsors
64
60
Thank you to all the sponsors who support this project!
65
61
66
-
<!-- sponsors --><!-- sponsors -->
67
-
68
62
If you use this library for a commercial product please consider [sponsoring the development](https://github.com/sponsors/h2zero) to ensure the continued updates and maintenance.
Copy file name to clipboardExpand all lines: docs/1.x_to2.x_migration_guide.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ This guide will help you migrate your application code to use the new API.
7
7
The changes listed here are only the required changes that must be made, and a short overview of options for migrating existing applications.
8
8
9
9
*[General changes](#general-changes)
10
+
*[Bond migration](#bond-migration)
10
11
*[BLE Device](#ble-device)
11
12
*[BLE Addresses](#ble-addresses)
12
13
*[BLE UUID's](#ble-uuids)
@@ -34,6 +35,49 @@ The changes listed here are only the required changes that must be made, and a s
34
35
`NimBLEServerCallbacks::onConnect(NimBLEServer* pServer)` signature is now `NimBLEServerCallbacks::onConnect(NimBLEServer* pServer, NimBLEConnInfo& connInfo)`.
35
36
<br/>
36
37
38
+
## Bond migration
39
+
If your 1.x application stores bonds and you want paired devices to continue working after upgrading to 2.x, the library provides helper functions to migrate the bond data stored in NVS.
40
+
41
+
The helpers are declared in `NimBLEBondMigration.h`:
42
+
43
+
-`NimBLEBondMigration::migrateBondStoreToCurrent()` converts 1.x bond data to the current 2.x format.
44
+
-`NimBLEBondMigration::migrateBondStoreToV1()` converts current bond data back to the 1.x format.
45
+
-`NimBLEBondMigration::dumpBondData()` returns a human-readable dump of the stored bond records for debugging.
46
+
47
+
These functions must be called **before**`NimBLEDevice::init()` so the bond store can be updated before the stack starts using it.
48
+
49
+
Typical migration flow:
50
+
51
+
1. Build and flash a temporary migration firmware that includes `NimBLEBondMigration.h`.
52
+
2. Call `migrateBondStoreToCurrent()` once during startup before BLE initialization.
53
+
3. If the function returns `true`, stop there and then flash the final 2.x application firmware.
54
+
4. After the migration is complete, do not run the migration again in normal application startup.
// Flash the normal 2.x firmware after this one-time step.
65
+
while (true) {
66
+
delay(1000);
67
+
}
68
+
}
69
+
70
+
NimBLEDevice::init("NimBLE");
71
+
}
72
+
73
+
Notes:
74
+
75
+
- These helpers currently require `ESP_PLATFORM` because they operate directly on the ESP NVS bond storage.
76
+
-`dumpBondData()` is useful before and after migration to verify what records are present.
77
+
- If you need to temporarily return to a 1.x firmware image while preserving bonds, run `migrateBondStoreToV1()` first, then flash the 1.x application.
78
+
- See the `examples/NimBLE_Bond_Migration` example for a complete one-time migration sketch.
79
+
<br/>
80
+
37
81
## BLE Device
38
82
- Ignore list functions and vector have been removed, the application should implement this if desired. It was no longer used by the library.
39
83
-`NimBLEDevice::startSecurity` now returns a `bool`, true on success, instead of an int to be consistent with the rest of the library.
0 commit comments