Skip to content

Commit

Permalink
Undo return as reference changes in getters for optional
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed Apr 30, 2024
1 parent d9fc64f commit 1a68a9b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/dnssd/Advertiser.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class BaseAdvertisingParams
mTcpSupported = tcpSupported;
return *reinterpret_cast<Derived *>(this);
}
const std::optional<bool> & GetTcpSupported() const { return mTcpSupported; }
std::optional<bool> GetTcpSupported() const { return mTcpSupported; }

Derived & SetICDModeToAdvertise(ICDModeAdvertise operatingMode)
{
Expand Down Expand Up @@ -181,14 +181,14 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams<CommissionA
mVendorId = vendorId;
return *this;
}
const std::optional<uint16_t> & GetVendorId() const { return mVendorId; }
std::optional<uint16_t> GetVendorId() const { return mVendorId; }

CommissionAdvertisingParameters & SetProductId(std::optional<uint16_t> productId)
{
mProductId = productId;
return *this;
}
const std::optional<uint16_t> & GetProductId() const { return mProductId; }
std::optional<uint16_t> GetProductId() const { return mProductId; }

CommissionAdvertisingParameters & SetCommissioningMode(CommissioningMode mode)
{
Expand All @@ -202,7 +202,7 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams<CommissionA
mDeviceType = deviceType;
return *this;
}
const std::optional<uint32_t> & GetDeviceType() const { return mDeviceType; }
std::optional<uint32_t> GetDeviceType() const { return mDeviceType; }

CommissionAdvertisingParameters & SetDeviceName(std::optional<const char *> deviceName)
{
Expand Down Expand Up @@ -263,7 +263,7 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams<CommissionA
mPairingHint = pairingHint;
return *this;
}
const std::optional<uint16_t> & GetPairingHint() const { return mPairingHint; }
std::optional<uint16_t> GetPairingHint() const { return mPairingHint; }

CommissionAdvertisingParameters & SetCommissionAdvertiseMode(CommssionAdvertiseMode mode)
{
Expand All @@ -277,7 +277,7 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams<CommissionA
mCommissionerPasscodeSupported = commissionerPasscodeSupported;
return *this;
}
const std::optional<bool> & GetCommissionerPasscodeSupported() const { return mCommissionerPasscodeSupported; }
std::optional<bool> GetCommissionerPasscodeSupported() const { return mCommissionerPasscodeSupported; }

private:
uint8_t mShortDiscriminator = 0;
Expand Down

0 comments on commit 1a68a9b

Please sign in to comment.