Advertising start did not return a value to indicate success/failure,
this patch adds that functionality. In addition, more verbose logging of errors from
this function are provided with the removal of the related asserts.
* Minor code cleanup
Previously when the host reset while scanning (if active prior) it would be restarted automatically.
This caused errors for some applications and has been removed since the event invokes the scan
ended callback for the app to take action. Instead scanning will now only be restarted if the duration
was indefinite and a callback was set for the advertisment events, this use case is less likely to have
a scan ended callback.
Advertising (if active prior) would be started without regard to it's previous state.
This has been corrected to only start advertising again if it was advertising for an idefinite time.
* Adds functionality to advertise for a set duration, similar to NimBLEScan::start.
The first parameter being the duration (in seconds).
The second parameter is a pointer to a callback function that is invoked when advertising stops.
* NimBLEAdvertising::isAdvertising method added, returns true if advertising is currently active.
* These methods were noop's and are now removed due to lack of usefulness and advertisment space consumed if used.
Applications can still manually set these values if desired using NimBLEAdvertisementData::addData.
* Get service handles on server start
* remove service + indicate service changed
* Reset gatt services when no connections active and services changed.
* NimBLEServer::createService can now be used any time and will send service changed
indication if server was already active.
* Add ability to remove advertised serviceUUIDS
* Adds addService() method to server to be allow user to re-add a service previously removed
* Add destructior to NimBLEServer, NimBLEService and NimBLECharacteristic to release allocated resources.
* Use critical sections to access characteristic/descriptor value data.
* Remove unnecessary code
* Create characteristic semaphore only if needed for indications.
* Fix advertising when not broadcasting a service.
This allows NimBLE options in menuconfig to reduce code size based on
the roles selected (scan/advertising/central/peripheral).
Significant code space can be saved by removing unnecessary roles for the application.