[mle] update DelayedSender to keep the tx schedule (#10846)

This commit updates how `Mle::DelayedSender` sends MLE messages after
a delay.

Previously, a delayed message was fully prepared and placed in a
queue, waiting for its delay duration to expire. In the new model, a
delayed message is prepared when the requested delay time expires and
the message transmission time is reached. The message is constructed
right before transmission. This ensures that the delayed message
includes the most up-to-date information and simplifies the methods
that prepare and send different types of MLE messages.

`DelayedSender` now keeps track of the message type and the
specific information required to construct the message later. For
example, for a delayed Parent Response to a Parent Request, the
extended address and the `RxChallenge` of the child are saved.

This new model makes it easier to implement the desired behavior when
similar messages are already scheduled to the same destination. For
example:
-   For Data Request, if one is already scheduled, a new request can
    be skipped, as the earlier Data Request will be valid.
-   For Parent Response, Link Accept, and Data Response, a new
    schedule request replaces an earlier one.
-   For Discovery Response, multiple schedules are allowed.
This commit is contained in:
Abtin Keshavarzian
2024-11-05 21:26:44 +01:00
committed by GitHub
parent e6a6b9fa0f
commit 7169561e79
5 changed files with 376 additions and 221 deletions
+2
View File
@@ -225,6 +225,8 @@ void InitTest(void)
void FinalizeTest(void)
{
AdvanceTime(30 * 1000);
SuccessOrQuit(otIp6SetEnabled(sInstance, false));
SuccessOrQuit(otThreadSetEnabled(sInstance, false));
// Make sure there is no message/buffer leak