improve & fix BLEScan when wantDuplicates (#3995)

* improve & fix BLEScan when too many BLE devices
- when wantDuplicates, no need to check duplicate and no more insert into vector
- delete advertisedDevice when not insert into vector, fix memory leak
- add showParse when you just want raw advertised data
This commit is contained in:
saknarak
2020-11-03 01:41:50 +07:00
committed by GitHub
parent c2346c37da
commit dccb4e8608
4 changed files with 38 additions and 17 deletions

View File

@ -388,6 +388,15 @@ void BLEAdvertisedDevice::parseAdvertisement(uint8_t* payload, size_t total_len)
} // !finished
} // parseAdvertisement
/**
* @brief Parse the advertising payload.
* @param [in] payload The payload of the advertised device.
* @param [in] total_len The length of payload
*/
void BLEAdvertisedDevice::setPayload(uint8_t* payload, size_t total_len) {
m_payload = payload;
m_payloadLength = total_len;
} // setPayload
/**
* @brief Set the address of the advertised device.