I am using the GattServer example as my reference, as found on GitHub.
We have a clock service and the UUID is provided as a char array.
_clock_service( /* uuid */ "51311102-030e-485f-b122-f8f381aa84ed", /* characteristics */ _clock_characteristics, /* numCharacteristics */ sizeof(_clock_characteristics) / sizeof(_clock_characteristics)
I now want to make reuse of this char array for the clock service.
However, when using the “AdvertisingDataBuilder” or “AdvertisingDataSimpleBuilder” class it is expecting the UUID to be in byte array only.
I tried to use getBaseUUID method from the UUID class but then when trying to apply the “mbed::make_Span” method it returns an error saying it does not have a template for the const char pointer returned by the getBaseUUID method.
This is in an attempt to use the following function
ble_error_t setLocalServiceList( mbed::Span<const UUID> data, bool complete = true );
ble_error_t setRequestedServiceList(mbed::Span<const UUID> data);
At the moment it just looks very messy and I’m struggling to get this to work.
So instead banging away aimlessly to resolve, I thought to open it up to the forum for guidance.
So what is the recommended method.