|
27 | 27 | #include <stdint.h>
|
28 | 28 |
|
29 | 29 | #include <lib/core/CHIPError.h>
|
| 30 | +#include <lib/core/Optional.h> |
30 | 31 | #include <lib/support/BitFlags.h>
|
31 | 32 | #include <lib/support/Pool.h>
|
32 | 33 | #include <messaging/ExchangeContext.h>
|
@@ -205,6 +206,26 @@ class ReliableMessageMgr
|
205 | 206 | }
|
206 | 207 | #endif // CHIP_CONFIG_TEST
|
207 | 208 |
|
| 209 | +#if CHIP_DEVICE_CONFIG_ENABLE_DYNAMIC_MRP_CONFIG |
| 210 | + /** |
| 211 | + * Set the value to add to the MRP backoff time we compute. This is meant to |
| 212 | + * account for high network latency on the sending side (us) that can't be |
| 213 | + * known to the message recipient and hence is not captured in the MRP |
| 214 | + * parameters the message recipient communicates to us. |
| 215 | + * |
| 216 | + * If set to NullOptional falls back to the compile-time |
| 217 | + * CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST. |
| 218 | + * |
| 219 | + * This is a static, not a regular member, because API consumers may need to |
| 220 | + * set this before actually bringing up the stack and having access to a |
| 221 | + * ReliableMessageMgr. |
| 222 | + */ |
| 223 | + static void SetAdditionaMRPBackoffTime(const Optional<System::Clock::Milliseconds64> & additionalTime) |
| 224 | + { |
| 225 | + sAdditionalMRPBackoffTime = additionalTime; |
| 226 | + } |
| 227 | +#endif // CHIP_DEVICE_CONFIG_ENABLE_DYNAMIC_MRP_CONFIG |
| 228 | + |
208 | 229 | private:
|
209 | 230 | /**
|
210 | 231 | * Calculates the next retransmission time for the entry
|
@@ -233,6 +254,10 @@ class ReliableMessageMgr
|
233 | 254 | ObjectPool<RetransTableEntry, CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE> mRetransTable;
|
234 | 255 |
|
235 | 256 | SessionUpdateDelegate * mSessionUpdateDelegate = nullptr;
|
| 257 | + |
| 258 | +#if CHIP_DEVICE_CONFIG_ENABLE_DYNAMIC_MRP_CONFIG |
| 259 | + static Optional<System::Clock::Milliseconds64> sAdditionalMRPBackoffTime; |
| 260 | +#endif // CHIP_DEVICE_CONFIG_ENABLE_DYNAMIC_MRP_CONFIG |
236 | 261 | };
|
237 | 262 |
|
238 | 263 | } // namespace Messaging
|
|
0 commit comments