5 years, 4 months ago.

How to get 128Bit Service IDs in advertising payload

Hey guys,

i'm trying to get my unique 128bit serivce UUID into ble advertising payload as follows:

AdvertisingDataSimpleBuilder

  error = this->ble->gap().setAdvertisingPayload(
      ble::LEGACY_ADVERTISING_HANDLE,
      ble::AdvertisingDataSimpleBuilder<ble::LEGACY_ADVERTISING_MAX_SIZE>()
          .setFlags()
          .setName(DEVICE_NAME)
          .setLocalServiceList(mbed::make_Span((const UUID *) this->submodule->gattServiceUUID, 1))
          .getAdvertisingData());

But it is not working. It shoots an assert:

Quote:

++ MbedOS Error Info ++ Error Status: 0x80FF0144 Code: 324 Module: 255 Error Message: Assertion failed: res == BLE_ERROR_NONE Location: 0x30021 File: ./mbed-os/features/FEATURE_BLE/ble/gap/AdvertisingDataSimpleBuilder.h+246 Error Value: 0x0 Current Thread: main Id: 0x20003448 Entry: 0x30F45 StackSize: 0x1000 StackMem: 0x20006FE8 SP: 0x20007E14

What is the right way for doing this?

Now it is working. I used AdvertisingDataBuilder instead of AdvertisingDataSimpleBuilder

posted by Wenzel Reichmuth 12 Aug 2019

1 Answer

5 years, 1 month ago.

Hello Wenzel, I have same difficulties because I'm very very new in C++. How did you resolve this with the "AdvertisingData Builder" ? suppose that it's with the "addData" ? Could you share your code or part of it ?

Thanks in advance, Jiemde