<divclass="textblock"><p>Many improvements have been made to this library vs the original, this is a brief overview of the most significant changes. Refer to the <ahref="https://h2zero.github.io/esp-nimble-cpp/annotated.html">class documentation</a> for further information on class specifics.</p>
<p><code>NimBLEService::NimBLEService::createCharacteristic</code> takes a 3rd parameter to specify the maximum data size that can be stored by the characteristic. This allows for limiting the RAM use of the characteristic in cases where small amounts of data are expected. <br/>
<p><code><aclass="el"href="class_nim_b_l_e_characteristic.html#aba05898f446e31222fbe509fa357c730"title="Template to set the characteristic value to <type>val.">NimBLECharacteristic::setValue(const T &s)</a></code><code><aclass="el"href="class_nim_b_l_e_descriptor.html#a9136cc9e4b41110b3dd99d1c9553a477"title="Template to set the characteristic value to <type>val.">NimBLEDescriptor::setValue(const T &s)</a></code></p>
<p>Now use the <code>NimbleAttValue</code> class and templates to accommodate standard and custom types/values.</p>
</div><!-- fragment --><p> This will send the struct to the receiving client when read or a notification sent.</p>
<p><code><aclass="el"href="class_nim_b_l_e_characteristic.html#a78484a01350300176033a09180f7207f"title="Retrieve the current value of the characteristic.">NimBLECharacteristic::getValue</a></code> now takes an optional timestamp parameter which will update it's value with the time the last value was received. In addition an overloaded template has been added to retrieve the value as a type specified by the user.</p>
<p>A new method <code><aclass="el"href="class_nim_b_l_e_server.html#a6bfd923ecd0ea06d5564343ab7209122"title="Set the server to automatically start advertising when a client disconnects.">NimBLEServer::advertiseOnDisconnect(bool)</a></code> has been implemented to control this, true(default) = enabled. <br/>
<p><code><aclass="el"href="class_nim_b_l_e_server.html#a00c92f62f41ec1c499dfaf042b487d75"title="Remove a service from the server.">NimBLEServer::removeService</a></code> takes an additional parameter <code>bool deleteSvc</code> that if true will delete the service and all characteristics / descriptors belonging to it and invalidating any pointers to them.</p>
<p>If false the service is only removed from visibility by clients. The pointers to the service and it's characteristics / descriptors will remain valid and the service can be re-added in the future using <code><aclass="el"href="class_nim_b_l_e_server.html#a6eda4c9e0ac1dd031c678d4bf7da1d56"title="Adds a service which was either already created but removed from availability, or created and later a...">NimBLEServer::addService</a></code>. <br/>
<p>Now takes 2 optional parameters, the first is the duration to advertise for (in seconds), the second is a callback that is invoked when advertising ends and takes a pointer to a <code><aclass="el"href="class_nim_b_l_e_advertising.html"title="Perform and manage BLE advertising.">NimBLEAdvertising</a></code> object (similar to the <code><aclass="el"href="class_nim_b_l_e_scan.html#a21b1e27816717b77533755f31dfaa820"title="Start scanning.">NimBLEScan::start</a></code> API).</p>
<p>This provides an opportunity to update the advertisement data if desired.</p>
<p><code><aclass="el"href="class_nim_b_l_e_remote_characteristic.html#a417bb44d000758535253488f4d77774a"title="Read the value of the remote characteristic.">NimBLERemoteCharacteristic::readValue</a>(time_t\*, bool)</code><code><aclass="el"href="class_nim_b_l_e_remote_descriptor.html#ac4e3a21818903b69ace41c36a58d3c46"title="Template to convert the remote descriptor data to <type>.">NimBLERemoteDescriptor::readValue(bool)</a></code></p>
<p>Have been added as templates to allow reading the values as any specified type.</p>
<p><code><aclass="el"href="class_nim_b_l_e_remote_characteristic.html#ab4f54eabe90a416546b7b3fc3477f49c"title="backward-compatibility method for subscribe/unsubscribe notifications/indications">NimBLERemoteCharacteristic::registerForNotify</a></code> Has been <b>deprecated</b> as now the internally stored characteristic value is updated when notification/indication is received.</p>
<p><code><aclass="el"href="class_nim_b_l_e_remote_characteristic.html#aa08b2f62376568e1fc833e4ff91e8aa7"title="Subscribe for notifications or indications.">NimBLERemoteCharacteristic::subscribe</a></code> and <code><aclass="el"href="class_nim_b_l_e_remote_characteristic.html#a6e331afdbdbc32bf461c9866236a97aa"title="Unsubscribe for notifications or indications.">NimBLERemoteCharacteristic::unsubscribe</a></code> have been implemented to replace it. A callback is no longer required to get the most recent value unless timing is important. Instead, the application can call <code><aclass="el"href="class_nim_b_l_e_remote_characteristic.html#a6d0779ffe7e89449121428e7fd6083d8"title="Get the value of the remote characteristic.">NimBLERemoteCharacteristic::getValue</a></code> to get the last updated value any time. <br/>
<p>The <code>notify_callback</code> function is now defined as a <code>std::function</code> to take advantage of using <code>std::bind</code> to specify a class member function for the callback.</p>
</div><!-- fragment --><p><code><aclass="el"href="class_nim_b_l_e_remote_characteristic.html#a417bb44d000758535253488f4d77774a"title="Read the value of the remote characteristic.">NimBLERemoteCharacteristic::readValue</a></code> and <code><aclass="el"href="class_nim_b_l_e_remote_characteristic.html#a6d0779ffe7e89449121428e7fd6083d8"title="Get the value of the remote characteristic.">NimBLERemoteCharacteristic::getValue</a></code> take an optional timestamp parameter which will update it's value with the time the last value was received.</p>
<p><aclass="el"href="class_nim_b_l_e_client.html#ae22379ab10bd82932d2303fb3753c366"title="Get the service BLE Remote Service instance corresponding to the uuid.">NimBLEClient::getService</a><br/>
<aclass="el"href="class_nim_b_l_e_remote_service.html#ab12d195a2239a3808d60457184f0c487"title="Get the remote characteristic object for the characteristic UUID.">NimBLERemoteService::getCharacteristic</a><br/>
<aclass="el"href="class_nim_b_l_e_remote_characteristic.html#a6178e1c58361b957be3c48548c1c4366"title="Get the descriptor instance with the given UUID that belongs to this characteristic.">NimBLERemoteCharacteristic::getDescriptor</a></p>
<p>These methods will now check the respective vectors for the attribute object and, if not found, will retrieve (only) the specified attribute from the peripheral.</p>
<p><code><aclass="el"href="class_nim_b_l_e_client.html#ae9b3e8a9b47c7eaad040b485bda958a1"title="Connect to an advertising device.">NimBLEClient::connect()</a></code> can now be called without an address or advertised device parameter. This will connect to the device with the address previously set when last connected or set with <code>NimBLEDevice::setPeerAddress()</code>.</p>
<p>To reduce resource use all instances of <code>std::map</code> have been replaced with <code>std::vector</code>.</p>
<p>Use of <code>FreeRTOS::Semaphore</code> has been removed as it was consuming too much ram, the related files have been left in place to accomodate application use.</p>
<p>Operators <code>==</code>, <code>!=</code> and <code>std::string</code> have been added to <code><aclass="el"href="class_nim_b_l_e_address.html"title="A BLE device address.">NimBLEAddress</a></code> and <code><aclass="el"href="class_nim_b_l_e_u_u_i_d.html"title="A model of a BLE UUID.">NimBLEUUID</a></code> for easier comparison and logging.</p>
<p>New constructor for <code><aclass="el"href="class_nim_b_l_e_u_u_i_d.html"title="A model of a BLE UUID.">NimBLEUUID(uint32_t, uint16_t, uint16_t, uint64_t)</a></code> added to lower memory use vs string construction. See: <ahref="https://github.com/h2zero/NimBLE-Arduino/pull/21">#21</a>.</p>
<p>Security/pairing operations are now handled in the respective <code><aclass="el"href="class_nim_b_l_e_client_callbacks.html"title="Callbacks associated with a BLE client.">NimBLEClientCallbacks</a></code> and <code><aclass="el"href="class_nim_b_l_e_server_callbacks.html"title="Callbacks associated with the operation of a BLE server.">NimBLEServerCallbacks</a></code> classes, <code><aclass="el"href="class_nim_b_l_e_security.html"title="A class to handle BLE security operations. Deprecated - provided for backward compatibility only.">NimBLESecurity</a></code>(deprecated) remains for backward compatibility.</p>
<p>Configuration options have been added to add or remove debugging information, when disabled (default) significantly reduces binary size. In ESP-IDF the options are in menuconfig: <code>Main menu -> ESP-NimBLE-cpp configuration</code>. <br/>
For Arduino the options must be commented / uncommented in <aclass="el"href="nimconfig_8h.html">nimconfig.h</a>.</p>
<p>Characteristics and descriptors now use the <code><aclass="el"href="class_nim_b_l_e_att_value.html"title="A specialized container class to hold BLE attribute values.">NimBLEAttValue</a></code> class to store their data. This is a polymorphic container class capable of converting to/from many different types efficiently. See: <ahref="https://github.com/h2zero/NimBLE-Arduino/pull/286">#286</a></p>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.9.1 </li>