esp32-snippets icon indicating copy to clipboard operation
esp32-snippets copied to clipboard

Is it possible to change the duration of the scan from uint32_t to float?

Open reveriess opened this issue 4 years ago • 2 comments

i need the BLE to scan and re-scan in less than 1 second interval. i tried to change the data type of duration from uint32_t to float. it can be compiled and uploaded to my ESP32 WROOM devkit v1 but now it couldn't scan anything.

is there another way to do this? or does the scantime is limited to integer seconds only? thanks

reveriess avatar Jun 22 '21 06:06 reveriess

No, it is not possible. It is how esp-idf API is designed.

chegewara avatar Jun 22 '21 06:06 chegewara

Hi there, apologies for being a few months late to the party. Is there an alternative to using this library? Under https://github.com/nkolban/ESP32_BLE_Arduino The author states that BLE is now directly included within the Arduino, but I haven't been able to find good documentation on how to use the library.

@reveriess This post here https://www.esp32.com/viewtopic.php?t=7615 mentions that:

Inside your void onResult function at the beginning, if you write: advertisedDevice.getScan()->stop();

It will stop the currently ongoing scan. Might not be a perfect solution, but its a temporary work around for me. Cheers @chegewara :)

adojang avatar Sep 29 '21 13:09 adojang