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
@@ -96,8 +106,9 @@ These changes allow more control for the user to manage the resources used for t
96
106
`NimBLEClient::connect()` can now be called without an address or advertised device parameter. This will connect to the
97
107
device with the address previously set when last connected or set with `NimBLEDevice::setPeerAddress()`.
98
108
109
+
<aname="general"></a>
99
110
# General
100
-
To reduce resource use all instances of std::map have been replaced with std::vector.
111
+
To reduce resource use all instances of `std::map` have been replaced with `std::vector`.
101
112
102
113
Use of `FreeRTOS::Semaphore` has been removed as it was consuming too much ram, the related files have been left in place to accomodate application use.
103
114
@@ -110,7 +121,5 @@ Security/pairing operations are now handled in the respective `NimBLEClientCallb
110
121
Configuration options have been added to add or remove debugging information, when disabled (default) significatly reduces binary size.
111
122
In ESP-IDF the options are in menuconfig: `Main menu -> ESP-NimBLE-cpp configuration`.
112
123
For Arduino the options must be commented / uncommented in nimconfig.h.
113
-
114
-
Many more internal improvements have been made as well, this is a brief overview. Refer to the class docs for futher information on class specifics.
Copy file name to clipboardExpand all lines: docs/Migration_guide.md
+86-29Lines changed: 86 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This guide describes the required changes to existing projects migrating from the original bluedroid API to NimBLE.
4
4
5
-
The changes listed here are only the **required changes that must be made** and a short overview of options for migrating existing applications.
5
+
**The changes listed here are only the required changes that must be made**, and a short overview of options for migrating existing applications.
6
6
7
7
For more information on the improvements and additions please refer to the [class documentation](https://h2zero.github.io/esp-nimble-cpp/annotated.html) and [Improvements and updates](Improvements_and_updates.md)
8
8
@@ -11,13 +11,18 @@ For more information on the improvements and additions please refer to the [clas
All classes are accessible by including `NimBLEDevice.h` in your application, no further headers need to be included.
@@ -42,20 +47,22 @@ For example `BLEAddress addr(11:22:33:44:55:66, 1)` will create the address obje
42
47
43
48
As this paramameter is optional no changes to existing code are needed, it is mentioned here for information.
44
49
<br/>
45
-
46
-
## Server API {#server-api}
50
+
<aname="server-api"></a>
51
+
## Server API
47
52
Creating a `BLEServer` instance is the same as original, no changes required.
48
53
For example `BLEDevice::createServer()` will work just as it did before.
49
54
50
55
`BLEServerCallbacks` (`NimBLEServerCallbacks`) has new methods for handling security operations.
51
56
**Note:** All callback methods have default implementations which allows the application to implement only the methods applicable.
52
57
<br/>
53
58
54
-
### Services {#services}
59
+
<aname="services"></a>
60
+
### Services
55
61
Creating a `BLEService` (`NimBLEService`) instance is the same as original, no changes required.
56
62
For example `BLEServer::createService(SERVICE_UUID)` will work just as it did before.
57
63
58
-
### Characteristics {#characteristics}
64
+
<aname="characteristics"></a>
65
+
### Characteristics
59
66
`BLEService::createCharacteristic` (`NimBLEService::createCharacteristic`) is used the same way as originally except the properties parameter has changed.
60
67
61
68
When creating a characteristic the properties are now set with `NIMBLE_PROPERTY::XXXX` instead of `BLECharacteristic::XXXX`.
`BLECharacteristicCallbacks` (`NimBLECharacteristicCallbacks`) has a new method `NimBLECharacteristicCallbacks::onSubscribe` which called when a client subscribes to notifications/indications.
113
+
`BLECharacteristicCallbacks` (`NimBLECharacteristicCallbacks`) has a new method `NimBLECharacteristicCallbacks::onSubscribe`
114
+
which is called when a client subscribes to notifications/indications.
115
+
107
116
**Note:** All callback methods have default implementations which allows the application to implement only the methods applicable.
108
117
<br/>
109
118
110
-
### Descriptors {descriptors}
119
+
> BLECharacteristic::getData
120
+
121
+
**Has been removed from the API.**
122
+
Originally this returned a `uint8_t*` to the internal data, which is volatile.
123
+
To prevent possibly throwing exceptions this has been removed and `NimBLECharacteristic::getValue` should be used
124
+
to get a copy of the data first which can then safely be accessed via pointer.
Copy file name to clipboardExpand all lines: docs/New_user_guide.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,8 @@ If you're not creating a server or do not want to advertise a name, simply pass
21
21
This can be called any time you wish to use BLE functions and does not need to be called from app_main(IDF) or setup(Arduino) but usually is.
22
22
<br/>
23
23
24
-
## Creating a Server {#creating-a-server}
24
+
<aname="creating-a-server"></a>
25
+
## Creating a Server
25
26
BLE servers perform 2 tasks, they advertise their existance for clients to find them and they provide services which contain information for the connecting client.
26
27
27
28
After initializing the NimBLE stack we create a server by calling `NimBLEDevice::createServer()`, this will create a server instance and return a pointer to it.
@@ -136,7 +137,8 @@ Now if you scan with your phone using nRFConnect or any other BLE app you should
136
137
For more advanced features and options please see the server examples in the examples folder.
137
138
<br/>
138
139
139
-
## Creating a Client {#creating-a-client}
140
+
<aname="creating-a-client"></a>
141
+
## Creating a Client
140
142
141
143
BLE clients perform 2 tasks, they scan for advertising servers and form connections to them to read and write to their characteristics/descriptors.
0 commit comments