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

Refactor NimBLEExtAdvertising #759

Merged
merged 3 commits into from
Nov 28, 2024
Merged

Refactor NimBLEExtAdvertising #759

merged 3 commits into from
Nov 28, 2024

Commits on Nov 28, 2024

  1. Refactor NimBLEExtAdvertising

    * General code cleanup
    * `NimBLEExtAdvertisement` : All functions that set data now return `bool`, true = success.
    * Added new method, `NimBLEExtAdvertisement::removeData`, which will remove the data of the specified type from the advertisement.
    * Added new method, `NimBLEExtAdvertisement::addServiceUUID`, which will append to the service uuids advertised.
    * Added new method, `NimBLEExtAdvertisement::removeServiceUUID`, which will remove the service from the uuids advertised.
    * Added new method, `NimBLEExtAdvertisement::removeServices`, which will remove all service uuids advertised.
    * Added overloads for `NimBLEExtAdvertisement::setServiceData` with the parameters `const NimBLEUUID& uuid, const uint8_t* data, size_t length` and
      `const NimBLEUUID& uuid, const std::vector<uint8_t>& data`.
    * Added new method, `NimBLEExtAdvertisement::getDataLocation`, which returns the location in the advertisment data of the type requested in parameter `uint8_t type`.
    * Added new method, `toString` which returns a Hex string representation of the advertisement data.
    h2zero committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    e6599a3 View commit details
    Browse the repository at this point in the history
  2. Add extended scan features.

    * Added new method `NimBLEScan::setScanPhy` to enable/disable the PHY's to scan on.
    * Added new method `NimBLEScan::setScanPeriod` which will allow for setting a scan restart timer in the controller.
    * Updated `NimBLEScan::start` to allow the command to be sent with updated parameters if already scanning.
    * Added extended scan example.
    * Removed storing and restarting of the scan on host reset as it is more appropriate to call the scanEnded callback instead.
    h2zero committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    e750a9e View commit details
    Browse the repository at this point in the history
  3. Add methods to set/get connection PHY's.

    * Added `NimBLEDevice::setDefaultPhy` which will set the default preferred PHY for all connections.
    * Added `NimBLEClient::updatePhy` to request a PHY change with a peer.
    * Added `NimBLEClient::getPhy` to read the current connection PHY setting.
    * Added `NimBLEServer::updatePhy` to request a PHY change with a peer.
    * Added `NimBLEServer::getPhy` to read the PHY of a peer connection.
    * Added callbacks:
    * - `NimBLEClientCallbacks::onPhyUpdate`
    * - `NimBLEServerCallbacks::onPhyUpdate`
     Which are called when the PHY update is complete.
    h2zero committed Nov 28, 2024
    Configuration menu
    Copy the full SHA
    fbe20f1 View commit details
    Browse the repository at this point in the history