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
[Error] Span.h@679,9: cannot initialize a member subobject of type ‘mbed::Span<const UUID, -1>::pointer’ (aka ‘const UUID ') with an rvalue of type ‘mbed::Span<const unsigned char, -1>::pointer’ (aka 'const unsigned char ')
[Error] Span.h@681,9: static_assert failed due to requirement 'span_detail::is_convertible<unsigned char const ()[1], UUID const ()[1]>::value’ “OtherElementType()[] should be convertible to ElementType ()”
In file included from ./mbed-os/features/FEATURE_BLE/ble/BLETypes.h:24:
./mbed-os/platform/Span.h:679:9: error: cannot initialize a member subobject of type ‘mbed::Span<const UUID, -1>::pointer’ (aka ‘const UUID *’) with an rvalue of type ‘mbed::Span<const unsigned char, -1>::pointer’ (aka ‘const unsigned char *’)
_data(other.data()), _size(other.size())
./source/BLEProcess.h:193:47: note: in instantiation of function template specialization ‘mbed::Span<const UUID, -1>::Span<const unsigned char, -1>’ requested here
_adv_data_builder.setLocalServiceList(mbed::make_Span(uuidpntr,UUIDlen),1);
Unless someone else can confirm, but I think this is a shortcoming with the BLE library in that the function setLocalServiceList only caters for one type of UUID class, namely: