diff --git a/features/FEATURE_BLE/ble/GapAdvertisingData.h b/features/FEATURE_BLE/ble/GapAdvertisingData.h index 5235ef1bca..52aa7e991d 100644 --- a/features/FEATURE_BLE/ble/GapAdvertisingData.h +++ b/features/FEATURE_BLE/ble/GapAdvertisingData.h @@ -930,9 +930,9 @@ private: } protected: - AdvertisingData(AdvertisingData& other) { - _buffer = mbed::make_Span(other.getPayload(), other.getBufferSize()); - _payloadLen = other.getPayloadLen(); + AdvertisingData(const AdvertisingData& other) : + _buffer(other._buffer), + _payloadLen(other._payloadLen) { } protected: