Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] - Refactor NimBLEScan #755

Merged
merged 1 commit into from
Nov 21, 2024
Merged

[BREAKING] - Refactor NimBLEScan #755

merged 1 commit into from
Nov 21, 2024

Conversation

h2zero
Copy link
Owner

@h2zero h2zero commented Nov 18, 2024

  • General code cleanup
  • NimBLEScan::start will no longer clear cache or results if scanning is already in progress.
  • NimBLEScan::clearResults will now reset the vector capacity to 0.
  • NimBLEScan::stop will no longer call the onScanEnd callback as the caller should know its been stopped when this is called.
  • NimBLEScan::clearDuplicateCache has been removed as it was problematic and only for the esp32. Stop and start the scanner for the same effect.
  • NimBLEScan::start takes a new bool parameter restart, default true, that will restart an already in progress scan and clear the duplicate filter so all devices will be discovered again.
  • Scan response data that is received without advertisement first will now create the device and send a callback.
  • Added new method: NimBLEAdvertisedDevice::isScannable() that returns true if the device is scannable.
  • Added default callbacks for NimBLEScanCallbacks
  • NimBLEScanCallbacks function signatures updated:
    • onDiscovered now takes a const NimBLEAdvertisedDevice*
    • onResult now takes a const NimBLEAdvertisedDevice*
    • onScanEnd now takes a const NimBLEScanResults& and int reason
  • Added new erase overload: NimBLEScan::erase(const NimBLEAdvertisedDevice* device)
  • NimBLEScanResults::getDevice methods now return const NimBLEAdvertisedDevice*
  • NimBLEScanResults iterators are now const_iterator

@h2zero h2zero force-pushed the refactor-scan branch 3 times, most recently from d095c73 to 9780d83 Compare November 21, 2024 01:17
* General code cleanup
* `NimBLEScan::start` will no longer clear cache or results if scanning is already in progress.
* `NimBLEScan::clearResults` will now reset the vector capacity to 0.
* `NimBLEScan::stop` will no longer call the `onScanEnd` callback as the caller should know its been stopped when this is called.
* `NimBLEScan::clearDuplicateCache` has been removed as it was problematic and only for the esp32. Stop and start the scanner for the same effect.
* `NimBLEScan::start` takes a new bool parameter `restart`, default `true`, that will restart an already in progress scan and clear the duplicate filter so all devices will be discovered again.
* Scan response data that is received without advertisement first will now create the device and send a callback.
* Added new method: `NimBLEAdvertisedDevice::isScannable()` that returns true if the device is scannable.
* Added default callbacks for `NimBLEScanCallbacks`
* `NimBLEScanCallbacks` function signatures updated:
* - `onDiscovered` now takes a `const NimBLEAdvertisedDevice*`
* - `onResult` now takes a `const NimBLEAdvertisedDevice*`
* - `onScanEnd` now takes a `const NimBLEScanResults&` and `int reason`
* Added new erase overload: `NimBLEScan::erase(const NimBLEAdvertisedDevice* device)`
* `NimBLEScanResults::getDevice` methods now return `const NimBLEAdvertisedDevice*`
* `NimBLEScanResults` iterators are now `const_iterator`
@h2zero h2zero merged commit 6ac6241 into master Nov 21, 2024
31 checks passed
@h2zero h2zero deleted the refactor-scan branch November 21, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant