[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.
NimBLEAdvertisementData
moved to it's own .h and .cpp files.NimBLEAdvertising::setPreferredParams
that takes the min and max preferred connection parameters as an alternative forsetMinPreferred
andsetMaxPreferred
.NimBLEAdvertising::setAdvertisingInterval
Sets the advertisement interval for min and max to the same value instead of callingsetMinInterval
andsetMaxInterval
separately if there is not value difference.NimBLEAdvertisementData
payload is now stored instd::vector<uint8_t>
instead ofstd::string
.NimBLEAdvertisementData::getPayload
now returnsstd::vector<uint8_t>
instead ofstd::string
.NimBLEAdvertisementData::addData
now takes either astd::vector<uint8_t>
oruint8_t* + length
instead ofstd::string
orchar + length
.NimBLEAdvertisementData::setName
now takes an optionalbool
parameter to indicate if the name is complete or incomplete, default = complete.NimBLEAdvertising::start
No longer takes a callback pointer parameter, instead the new methodNimBLEAdvertising::setAdvertisingCompleteCallback
should be used.NimBLEAdvertising::setAdvertisementType
has been renamed toNimBLEAdvertising::setConnectableMode
to better reflect it's function.NimBLEAdvertising::setDiscoverableMode
to allow applications to control the discoverability of the advertiser.NimBLEAdvertising::setManufacturerData
that takes aconst uint8_t*
and , size_t` paramter.NimBLEAdvertising::setServiceData
that takesconst NimBLEUUID& uuid
,const uint8_t* data
,size_t length
as parameters.NimBLEAdvertising::setServiceData
that takesconst NimBLEUUID& uuid
,const std::vector<uint8_t>&
as parameters.NimBLEAdvertisementData
functions that change data values now returnbool
, true = success.NimBLEAdvertising
functions that change data values now returnbool
, true = success.NimBLEAdvertising::setMinPreferred
andNimBLEAdvertising::setMaxPreferred
have been removed, useNimBLEAdvertising::setPreferredParams
instead.NimBLEAdvertisingData
and vectors removed fromNimBLEAdvertising
.NimBLEAdvertising::setAdvertisementData
andNimBLEAdvertising::setScanResponseData
now 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::removeServiceUUID
andNimBLEAdvertisementData::removeServiceUUID
to accept aconst char*
NimBLEAdvertising::clearData
, which will clear the advertisement and scan response data.Fixes #646