[Breaking] Change all time input parameters to milliseconds. (#78)

Changes all functions that accept a time parameter to use milliseconds instead of seconds.

* Adds duration input to NimBLEDevice::startAdvertising and NimBLEServer::startAdvertising.
This commit is contained in:
h2zero
2022-08-26 19:32:01 -06:00
committed by GitHub
parent 0b6337538c
commit bb3dd5f114
14 changed files with 36 additions and 35 deletions

View File

@@ -748,15 +748,16 @@ bool NimBLEServer::stopAdvertising(uint8_t inst_id) {
} // stopAdvertising
#endif
#if !CONFIG_BT_NIMBLE_EXT_ADV|| defined(_DOXYGEN_)
#if !CONFIG_BT_NIMBLE_EXT_ADV || defined(_DOXYGEN_)
/**
* @brief Start advertising.
* @param [in] duration The duration in milliseconds to advertise for, default = forever.
* @return True if advertising started successfully.
* @details Start the server advertising its existence. This is a convenience function and is equivalent to
* @details Start the server advertising its existence. This is a convenience function and is equivalent to
* retrieving the advertising object and invoking start upon it.
*/
bool NimBLEServer::startAdvertising() {
return getAdvertising()->start();
bool NimBLEServer::startAdvertising(uint32_t duration) {
return getAdvertising()->start(duration);
} // startAdvertising
#endif