3 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
Comment on this question
Be the first to answer this question.

You need to log in to post a question