Skip to content

Commit d8a535d

Browse files
h2zerowakwak-koba
andcommitted
Update documentation
Co-authored-by: wakwak-koba <[email protected]>
1 parent 100edee commit d8a535d

File tree

6 files changed

+31
-16
lines changed

6 files changed

+31
-16
lines changed

docs/BREAKING_API_CHANGES.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,17 @@ This can be changed to use passkey authentication or numeric comparison. See [Se
9999
The `NimBLEAdvertisedDeviceCallbacks::onResult()` method now receives a pointer to the
100100
`NimBLEAdvertisedDevice` object instead of a copy.
101101

102-
`NimBLEClient::connect()` now takes an extra parameter to indicate if the client should download the services
103-
database from the peripheral, default value is true.
104-
102+
`NimBLEClient::connect()` Has had it's parameters altered.
105103
Defined as:
104+
> NimBLEClient::connect(bool refreshServices = true);
106105
> NimBLEClient::connect(NimBLEAdvertisedDevice\* device, bool refreshServices = true);
107-
> NimBLEClient::connect(NimBLEAddress address, uint8_t type = BLE_ADDR_PUBLIC, bool refreshServices = true);
106+
> NimBLEClient::connect(NimBLEAddress address, bool refreshServices = true);
107+
<br/>
108108
109-
If set to false the client will use the services database it retrieved from the peripheral last time it connected.
110-
This allows for faster connections and power saving if the devices just dropped connection and want to reconnect.
109+
The type parameter has been removed and a new bool parameter has been added to indicate if the client should
110+
delete the attribute database previously retrieved (if applicable) for the peripheral, default value is true.
111+
If set to false the client will use the attribute database it retrieved from the peripheral when previously connected.
112+
This allows for faster connections and power saving if the devices dropped connection and are reconnecting.
111113
<br/>
112114

113115
> NimBLERemoteCharacteristic::writeValue();
@@ -117,6 +119,7 @@ Now return true or false to indicate success or failure so you can choose to dis
117119
<br/>
118120

119121
> NimBLERemoteCharacteristic::registerForNotify();
122+
120123
Is now **deprecated**.
121124
> NimBLERemoteCharacteristic::subscribe()
122125
> NimBLERemoteCharacteristic::unsubscribe()
@@ -129,7 +132,7 @@ Are the new methods added to replace it.
129132
> NimBLERemoteCharacteristic::readUInt32()
130133
> NimBLERemoteCharacteristic::readFloat()
131134
132-
Are **deprecated** and NimBLERemoteCharacteristic::readValue(time_t\*, bool) template added to replace them.
135+
Are **deprecated** and NimBLERemoteCharacteristic::readValue<type\>(time_t\*, bool) template added to replace them.
133136
<br/>
134137

135138
> NimBLERemoteService::getCharacteristicsByHandle()
@@ -152,8 +155,9 @@ uint8_t *val = (uint8_t*)pChr->readValue().data();
152155
> NimBLERemoteService::getCharacteristics(bool refresh = false)
153156
154157
These methods now take an optional (bool) parameter and return a pointer to `std::vector` instead of `std::map`.
155-
If passed true it will clear the respective vector and retrieve all the respective attributes from the peripheral.
156-
If false(default) it will return the respective vector with the currently stored attributes.
158+
If passed true it will clear the respective vector and retrieve **all** the respective attributes from the peripheral.
159+
If false(default) it will return the respective vector with the currently stored attributes.
160+
<br/>
157161

158162
**Removed:** the automatic discovery of all peripheral attributes as they consumed time and resources for data
159163
the user may not be interested in.
@@ -177,6 +181,17 @@ The client will automatically initiate security when the peripheral responds tha
177181
The default configuration will use "just-works" pairing with no bonding, if you wish to enable bonding see below.
178182
<br/>
179183

184+
# General Differences
185+
`NimBLEAddress()` When constructing an address the constructor now takes an optional `uint8_t type` paramameter
186+
to specify the address type. Default is (0) Public static address.
187+
188+
Defined as:
189+
> NimBLEAddress(ble_addr_t address);
190+
> NimBLEAddress(uint8_t address[6], uint8_t type = BLE_ADDR_PUBLIC);
191+
> NimBLEAddress(const std::string &stringAddress, uint8_t type = BLE_ADDR_PUBLIC);
192+
> NimBLEAddress(const uint64_t &address, uint8_t type = BLE_ADDR_PUBLIC);
193+
<br/>
194+
180195
# Security Differences
181196
Security callback functions are now incorporated in the NimBLEServerCallbacks / NimBLEClientCallbacks classes.
182197
However backward compatibility with the original `BLESecurity` class is retained to minimize app code changes.

docs/Improvements_and_updates.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ NimBLEClient::getService will now retrieve only the service specified and not th
8787
otherwise wasted retrieving and allocating attributes the user application is not interested in.
8888
<br/>
8989

90+
NimBLEClient::connect() can now be called without an address or advertised device parameter. This will connect to the
91+
device with the address previously set when last connected or set with NimBLEDevice::setPeerAddress().
92+
9093
# General
9194
To reduce resource use all instances of std::map have been replaced with std::vector.
9295

src/NimBLEClient.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ bool NimBLEClient::connect(NimBLEAdvertisedDevice* device, bool deleteAttibutes)
152152
/**
153153
* @brief Connect to the BLE Server.
154154
* @param [in] address The address of the server.
155-
* @param [in] type The address type of the server (Random/public/other)
156155
* @param [in] deleteAttibutes If true this will delete any attribute objects this client may already\n
157156
* have created and clears the vectors after successful connection.
158157
* @return True on success.

src/NimBLEScan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void NimBLEScan::setActiveScan(bool active) {
161161
/**
162162
* @brief Set whether or not the BLE controller should only report results
163163
* from devices it has not already seen.
164-
* @param [in] active If true, scanned devices will only be reported once.
164+
* @param [in] enabled If true, scanned devices will only be reported once.
165165
* @details The controller has a limited buffer and will start reporting
166166
* dupicate devices once the limit is reached.
167167
*/
@@ -173,7 +173,7 @@ void NimBLEScan::setDuplicateFilter(bool enabled) {
173173
/**
174174
* @brief Set whether or not the BLE controller only report scan results
175175
* from devices advertising in limited discovery mode, i.e. directed advertising.
176-
* @param [in] active If true, only limited discovery devices will be in scan results.
176+
* @param [in] enabled If true, only limited discovery devices will be in scan results.
177177
*/
178178
void NimBLEScan::setLimitedOnly(bool enabled) {
179179
m_scan_params.limited = enabled;

src/NimBLEServer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,11 +534,9 @@ void NimBLEServer::removeService(NimBLEService* service, bool deleteSvc) {
534534

535535
/**
536536
* @brief Adds a service which was already created, but removed from availability.
537-
*
537+
* @param [in] service The service object to add.
538538
* @note If it is desired to advertise the service it must be added by
539539
* calling NimBLEAdvertising::addServiceUUID.
540-
*
541-
* @param [in} service The service object to add.
542540
*/
543541
void NimBLEServer::addService(NimBLEService* service) {
544542
// If adding a service that was not removed just return.

src/NimBLEUUID.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ bool NimBLEUUID::equals(const NimBLEUUID &uuid) const {
179179
* Create a NimBLEUUID from a string of the form:
180180
* 0xNNNN
181181
* 0xNNNNNNNN
182-
* 0x<UUID>
182+
* 0x<UUID\>
183183
* NNNN
184184
* NNNNNNNN
185185
* <UUID\>

0 commit comments

Comments
 (0)