[BREAKING] - Refactor NimBLEAdvertising #756
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NimBLEAdvertisementDatamoved to it's own .h and .cpp files.NimBLEAdvertising::setPreferredParamsthat takes the min and max preferred connection parameters as an alternative forsetMinPreferredandsetMaxPreferred.NimBLEAdvertising::setAdvertisingIntervalSets the advertisement interval for min and max to the same value instead of callingsetMinIntervalandsetMaxIntervalseparately if there is not value difference.NimBLEAdvertisementDatapayload is now stored instd::vector<uint8_t>instead ofstd::string.NimBLEAdvertisementData::getPayloadnow returnsstd::vector<uint8_t>instead ofstd::string.NimBLEAdvertisementData::addDatanow takes either astd::vector<uint8_t>oruint8_t* + lengthinstead ofstd::stringorchar + length.NimBLEAdvertisementData::setNamenow takes an optionalboolparameter to indicate if the name is complete or incomplete, default = complete.NimBLEAdvertising::startNo longer takes a callback pointer parameter, instead the new methodNimBLEAdvertising::setAdvertisingCompleteCallbackshould be used.NimBLEAdvertising::setAdvertisementTypehas been renamed toNimBLEAdvertising::setConnectableModeto better reflect it's function.NimBLEAdvertising::setDiscoverableModeto allow applications to control the discoverability of the advertiser.NimBLEAdvertising::setManufacturerDatathat takes aconst uint8_t*and , size_t` paramter.NimBLEAdvertising::setServiceDatathat takesconst NimBLEUUID& uuid,const uint8_t* data,size_t lengthas parameters.NimBLEAdvertising::setServiceDatathat takesconst NimBLEUUID& uuid,const std::vector<uint8_t>&as parameters.NimBLEAdvertisementDatafunctions that change data values now returnbool, true = success.NimBLEAdvertisingfunctions that change data values now returnbool, true = success.NimBLEAdvertising::setMinPreferredandNimBLEAdvertising::setMaxPreferredhave been removed, useNimBLEAdvertising::setPreferredParamsinstead.NimBLEAdvertisingDataand vectors removed fromNimBLEAdvertising.NimBLEAdvertising::setAdvertisementDataandNimBLEAdvertising::setScanResponseDatanow returnbool, true = success.NimBLEAdvertisementData::removeData, which takes a parameteruint8_t type, the data type to remove.NimBLEAdvertisementData::toString, which will print the data in hex.NimBLEAdvertising::getAdvertisementData, which returns a reference to the currently set advertisement data.NimBLEAdvertising::getScanData, which returns a reference to the currently set scan response data.NimBLEAdvertising::removeServiceUUIDandNimBLEAdvertisementData::removeServiceUUIDto accept aconst char*NimBLEAdvertising::clearData, which will clear the advertisement and scan response data.Fixes #646