24
24
#endif // CONFIG_NETWORK_LAYER_BLE
25
25
26
26
#include < lib/support/logging/CHIPLogging.h>
27
+ #include < messaging/ReliableMessageProtocolConfig.h>
27
28
#include < protocols/secure_channel/PASESession.h>
28
29
29
30
namespace chip {
30
31
31
32
// The largest supported value for Rendezvous discriminators
32
33
const uint16_t kMaxRendezvousDiscriminatorValue = 0xFFF ;
33
34
35
+ // The largest supported value for sleepy idle interval and sleepy active interval
36
+ constexpr uint32_t kMaxSleepyInterval = 3600000 ;
37
+
34
38
class RendezvousParameters
35
39
{
36
40
public:
@@ -93,6 +97,28 @@ class RendezvousParameters
93
97
bool HasConnectionObject () const { return false ; }
94
98
#endif // CONFIG_NETWORK_LAYER_BLE
95
99
100
+ bool HasMRPConfig () const { return mMRPConfig .HasValue (); }
101
+ ReliableMessageProtocolConfig GetMRPConfig () const { return mMRPConfig .ValueOr (GetDefaultMRPConfig ()); }
102
+ RendezvousParameters & SetIdleInterval (System::Clock::Milliseconds32 interval)
103
+ {
104
+ if (!mMRPConfig .HasValue ())
105
+ {
106
+ mMRPConfig .Emplace (GetDefaultMRPConfig ());
107
+ }
108
+ mMRPConfig .Value ().mIdleRetransTimeout = interval;
109
+ return *this ;
110
+ }
111
+
112
+ RendezvousParameters & SetActiveInterval (System::Clock::Milliseconds32 interval)
113
+ {
114
+ if (!mMRPConfig .HasValue ())
115
+ {
116
+ mMRPConfig .Emplace (GetDefaultMRPConfig ());
117
+ }
118
+ mMRPConfig .Value ().mActiveRetransTimeout = interval;
119
+ return *this ;
120
+ }
121
+
96
122
private:
97
123
Transport::PeerAddress mPeerAddress ; // /< the peer node address
98
124
uint32_t mSetupPINCode = 0 ; // /< the target peripheral setup PIN Code
@@ -101,6 +127,8 @@ class RendezvousParameters
101
127
Spake2pVerifier mPASEVerifier ;
102
128
bool mHasPASEVerifier = false ;
103
129
130
+ Optional<ReliableMessageProtocolConfig> mMRPConfig ;
131
+
104
132
#if CONFIG_NETWORK_LAYER_BLE
105
133
Ble::BleLayer * mBleLayer = nullptr ;
106
134
BLE_CONNECTION_OBJECT mConnectionObject = BLE_CONNECTION_UNINITIALIZED;
0 commit comments