Skip to content

Change advertising raw data setting #136

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

Merged
merged 1 commit into from
Nov 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/BLEAdvertisingData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ bool BLEAdvertisingData::setLocalName(const char *localName)
bool BLEAdvertisingData::setRawData(const uint8_t* data, int length)
{
if (length > MAX_AD_DATA_LENGTH) {
length = MAX_AD_DATA_LENGTH;
return false;
}
_rawData = data;
_rawDataLength = length;
Expand All @@ -195,11 +195,11 @@ bool BLEAdvertisingData::setRawData(const uint8_t* data, int length)

bool BLEAdvertisingData::setRawData(const BLEAdvertisingRawData& rawData)
{
if (rawData.length > MAX_AD_DATA_LENGTH) {
return false;
}
_rawData = rawData.data;
_rawDataLength = rawData.length;
if (_rawDataLength > MAX_AD_DATA_LENGTH) {
_rawDataLength = MAX_AD_DATA_LENGTH;
}
return true;
}

Expand Down