[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
+1 -5
View File
@@ -302,7 +302,7 @@ bool NimBLEScan::isScanning() {
/**
* @brief Start scanning.
* @param [in] duration The duration in seconds for which to scan.
* @param [in] duration The duration in milliseconds for which to scan.
* @param [in] scanCompleteCB A function to be called when scanning has completed.
* @param [in] is_continue Set to true to save previous scan results, false to clear them.
* @return True if scan started or false if there was an error.
@@ -319,10 +319,6 @@ bool NimBLEScan::start(uint32_t duration, void (*scanCompleteCB)(NimBLEScanResul
if(duration == 0){
duration = BLE_HS_FOREVER;
}
else{
// convert duration to milliseconds
duration = duration * 1000;
}
// Set the flag to ignore the results while we are deleting the vector
if(!is_continue) {