NimBLE-Arduino icon indicating copy to clipboard operation
NimBLE-Arduino copied to clipboard

[BREAKING] Refactor attributes

Open h2zero opened this issue 1 year ago • 0 comments

Refactor attributes to reduce code duplication and improve maintainability.

  • Add attribute base classes to provide common code.
  • Add const where possible to functions and parameters.
  • NimBLECharacteristic::notify no longer takes a bool is_notification parameter, instead indicate() should be called to send indications.
  • NimBLECharacteristic::indicate now takes the same parameters as notify.
  • NimBLECharacteristicCallbacks and NimBLEDescriptorCallbacks methods now take const NimBLEConnInfo& instead of non-const.
  • NimBLECharacteristic::onNotify callback removed as unnecessary, the library does not call notify without app input.
  • Add NimBLEUUID constructor that takes a reference to ble_uuid_any_t.
  • NimBLERemoteService::getCharacteristics now returns a const std::vector<NimBLERemoteCharacteristic*>& instead of non-const std::vector<NimBLERemoteCharacteristic*>*
  • NimBLERemoteService::getValue now returns NimBLEAttValue instead of std::string
  • NimBLEService::getCharacteristics now returns a const std::vector<NimBLECharacteristic*>& instead of a copy of std::vector<NimBLECharacteristic *>.

h2zero avatar Aug 10 '24 00:08 h2zero