mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-21 20:50:55 +01:00
fix(NimBLEAdvertising): Ensure setServiceData()
includes length of data
This commit is contained in:
parent
12074d1cc4
commit
cd115f1738
1 changed files with 1 additions and 1 deletions
|
@ -973,7 +973,7 @@ void NimBLEAdvertisementData::setServices(const bool complete, const uint8_t siz
|
||||||
*/
|
*/
|
||||||
void NimBLEAdvertisementData::setServiceData(const NimBLEUUID &uuid, const std::string &data) {
|
void NimBLEAdvertisementData::setServiceData(const NimBLEUUID &uuid, const std::string &data) {
|
||||||
uint8_t size = uuid.bitSize() / 8;
|
uint8_t size = uuid.bitSize() / 8;
|
||||||
char cdata[2] = {static_cast<char>(1 + size), BLE_HS_ADV_TYPE_SVC_DATA_UUID16};
|
char cdata[2] = {static_cast<char>(1 + size + data.length()), BLE_HS_ADV_TYPE_SVC_DATA_UUID16};
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case 2: {
|
case 2: {
|
||||||
// [Len] [0x16] [UUID16] data
|
// [Len] [0x16] [UUID16] data
|
||||||
|
|
Loading…
Reference in a new issue