Skip to content

Commit

Permalink
Remove build flag CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING since RMP is … (
Browse files Browse the repository at this point in the history
#2327)

* Remove build flag CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING since RMP is alwasy enabled

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
yufengwangca and restyled-commits authored Aug 25, 2020
1 parent 14263d9 commit b5135b3
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 184 deletions.
1 change: 0 additions & 1 deletion src/lib/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ buildconfig_header("chip_buildconfig") {
"HAVE_NEW=false",
"CHIP_CONFIG_MEMORY_MGMT_SIMPLE=${chip_config_memory_management_simple}",
"CHIP_CONFIG_MEMORY_MGMT_PLATFORM=${chip_config_memory_management_platform}",
"CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING=true",
"CHIP_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES=false",
]
}
Expand Down
23 changes: 2 additions & 21 deletions src/lib/message/CHIPBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,8 @@ void Binding::ResetConfig()

mTransportOption = kTransport_NotSpecified;
mDefaultResponseTimeoutMsec = 0;
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
mDefaultRMPConfig = gDefaultRMPConfig;
#endif
mUDPPathMTU = CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE;
mDefaultRMPConfig = gDefaultRMPConfig;
mUDPPathMTU = CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE;

mSecurityOption = kSecurityOption_NotSpecified;
mKeyId = ChipKeyId::kNone;
Expand Down Expand Up @@ -1217,8 +1215,6 @@ CHIP_ERROR Binding::NewExchangeContext(chip::ExchangeContext *& appExchangeConte
appExchangeContext = mExchangeManager->NewContext(mPeerNodeId, mPeerAddress, mPeerPort, mInterfaceId, NULL);
VerifyOrExit(NULL != appExchangeContext, err = CHIP_ERROR_NO_MEMORY);

#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING

// Set the default RMP configuration in the new exchange.
appExchangeContext->mRMPConfig = mDefaultRMPConfig;

Expand All @@ -1230,8 +1226,6 @@ CHIP_ERROR Binding::NewExchangeContext(chip::ExchangeContext *& appExchangeConte
appExchangeContext->SetAutoRequestAck(true);
}

#endif // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING

// If using a connection-oriented transport...
if (mTransportOption == kTransport_TCP || mTransportOption == kTransport_ExistingConnection)
{
Expand Down Expand Up @@ -1531,11 +1525,7 @@ Binding::Configuration & Binding::Configuration::Transport_UDP()
*/
Binding::Configuration & Binding::Configuration::Transport_UDP_RMP()
{
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
mBinding.mTransportOption = kTransport_UDP_RMP;
#else // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
mError = CHIP_ERROR_NOT_IMPLEMENTED;
#endif // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
return *this;
}

Expand All @@ -1562,12 +1552,7 @@ Binding::Configuration & Binding::Configuration::Transport_UDP_PathMTU(uint32_t
*/
Binding::Configuration & Binding::Configuration::Transport_DefaultRMPConfig(const chip::RMPConfig & aRMPConfig)
{
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
mBinding.mDefaultRMPConfig = aRMPConfig;
#else // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
IgnoreUnusedVariable(aRMPConfig);
mError = CHIP_ERROR_NOT_IMPLEMENTED;
#endif // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
return *this;
}

Expand Down Expand Up @@ -1840,11 +1825,7 @@ Binding::Configuration & Binding::Configuration::ConfigureFromMessage(const chip
{
if (aMsgInfo->Flags & kChipMessageFlag_PeerRequestedAck)
{
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
Transport_UDP_RMP();
#else
mError = CHIP_ERROR_NOT_IMPLEMENTED;
#endif // #if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
}
else
{
Expand Down
8 changes: 0 additions & 8 deletions src/lib/message/CHIPBinding.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ class Binding
uint8_t GetEncryptionType(void) const;
uint32_t GetDefaultResponseTimeout() const;
void SetDefaultResponseTimeout(uint32_t msec);
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
const RMPConfig & GetDefaultRMPConfig(void) const;
void SetDefaultRMPConfig(const RMPConfig & RMPConfig);
#endif // #if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
EventCallback GetEventCallback() const;
void SetEventCallback(EventCallback aEventCallback);
ChipConnection * GetConnection() const;
Expand Down Expand Up @@ -294,9 +292,7 @@ class Binding
ChipConnection * mCon;
uint32_t mDefaultResponseTimeoutMsec;
uint32_t mUDPPathMTU;
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
RMPConfig mDefaultRMPConfig;
#endif
uint8_t mHostNameLen;

// Security-specific configuration
Expand Down Expand Up @@ -520,8 +516,6 @@ inline void Binding::SetDefaultResponseTimeout(uint32_t timeout)
mDefaultResponseTimeoutMsec = timeout;
}

#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING

inline const RMPConfig & Binding::GetDefaultRMPConfig(void) const
{
return mDefaultRMPConfig;
Expand All @@ -532,8 +526,6 @@ inline void Binding::SetDefaultRMPConfig(const RMPConfig & aRMPConfig)
mDefaultRMPConfig = aRMPConfig;
}

#endif // #if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING

inline Binding::EventCallback Binding::GetEventCallback() const
{
return mAppEventCallback;
Expand Down
Loading

0 comments on commit b5135b3

Please sign in to comment.