diff --git a/src/lib/dnssd/Advertiser.h b/src/lib/dnssd/Advertiser.h index 2d443e5dd7db00..02888181f98181 100644 --- a/src/lib/dnssd/Advertiser.h +++ b/src/lib/dnssd/Advertiser.h @@ -108,7 +108,7 @@ class BaseAdvertisingParams mTcpSupported = tcpSupported; return *reinterpret_cast(this); } - const std::optional & GetTcpSupported() const { return mTcpSupported; } + std::optional GetTcpSupported() const { return mTcpSupported; } Derived & SetICDModeToAdvertise(ICDModeAdvertise operatingMode) { @@ -181,14 +181,14 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams & GetVendorId() const { return mVendorId; } + std::optional GetVendorId() const { return mVendorId; } CommissionAdvertisingParameters & SetProductId(std::optional productId) { mProductId = productId; return *this; } - const std::optional & GetProductId() const { return mProductId; } + std::optional GetProductId() const { return mProductId; } CommissionAdvertisingParameters & SetCommissioningMode(CommissioningMode mode) { @@ -202,7 +202,7 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams & GetDeviceType() const { return mDeviceType; } + std::optional GetDeviceType() const { return mDeviceType; } CommissionAdvertisingParameters & SetDeviceName(std::optional deviceName) { @@ -263,7 +263,7 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams & GetPairingHint() const { return mPairingHint; } + std::optional GetPairingHint() const { return mPairingHint; } CommissionAdvertisingParameters & SetCommissionAdvertiseMode(CommssionAdvertiseMode mode) { @@ -277,7 +277,7 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams & GetCommissionerPasscodeSupported() const { return mCommissionerPasscodeSupported; } + std::optional GetCommissionerPasscodeSupported() const { return mCommissionerPasscodeSupported; } private: uint8_t mShortDiscriminator = 0;