This commit updates behavior when device mode gets changed
so to re-attach on switching between MTD/FTD modes and also on
switching from rx-on to sleepy (rx-off) mode (when attached as a
child).
This commit also updates `test-027-child-mode-change.py` to match
the new behavior.
This commit updates the `Ip6::Mpl` to use `TimeTicker` instead of
its own `Timer` to age the entries in its `mSeedSet`. This commit
also updates the default number of seed entries by 3 to use the
memory saved by using `TimeTicker`.
Sometime we need to identify which platform we are currently using,
especially in a test cases, where a unified interface is provided to
control devices, the test cases have no idea about current platform.
- Use MLE `GetMeshLocal16()` to check if seed ID can be elided
(remove `mMatchingAddress).
- When processing MPL option if seed ID is elided, we ensure that
sender's address is RLOC format and use the RLOC16 as seed ID.
- When preparing MPL option directly use device's RLOC16 as seed ID
(removing `Mpl::Get/SetSeedId()` methods).
- Determine number of timer expirations (MPL retransmission) based
on device's current role.
This commit updates `Mpl::UpdateSeedSet()` to reset the `SeedEntry`
lifetime to `kSeedEntryLifetime` if we rx/tx a message with same
ID and sequence. This ensures that the entry is kept in the array
while other routers are forwarding the same message.
This commit updates `RegisterNetdataData()` to ensure that versions
are updated if there is any change even if there is an error during
integration of new entries (e.g., running out of space in Network
Data, or failing to allocate new service ID).
This commit fixes how we determine the CSL timings when preparing a
frame for CSL transmission. When scheduling the next CSL, we use
`mCslFrameRequestAheadUs` time in `GetNextCslTransmissionDelay()`. We
basically schedule `Mac` to start the CSL tx operation a bit earlier
than the desired CSL tx time. In `HandleFrameRequest()` (when we are
preparing the frame to be sent) we should be already within
`mCslFrameRequestAheadUs` time from the tx time. So this commit changes
the code such that we invoke `GetNextCslTransmissionDelay()` with zero
`aAheadUs` interval when preparing the frame. This ensures that we do not
skip the current CSL window and move to the next.
This commit also adds a check in `HandleFrameRequest()` to ensure that
we did not miss the current CSL window. This situation can happen if
`Mac` happens to be busy with some other operation and therefore late
to start CSL tx and invoke `HandleFrameRequest()`. In such a case we
don't want to use delay tx time for next CSL window (which may be way
later) and instead we abort the current CSL tx operation by returning
a `nullptr` frame.
This commit contains smaller enhancements in `RouteTlv`:
- `RouteTlv::IsValid()` checks that number of allocated IDs in
the Router ID Mask is less than max number of routers.
- It also checks that the TLV contains correct number of Route
Data entries matching the number of allocated router IDs.
- A new method `SetRouteData()` is added to set all the
data fields (link quality in/out and route cost) for a given
router index.
- These changes help ensure that messages containing invalid
`RouteTlv` are rejected (avoid situation where we may have
more allocated router IDs than max routers).
Fix an issue in which a CSL Transmitter would start to send malformed
frames to the radio in the ocassion of a data poll arriving while a
delayed CSL transmission was already scheduled.
Notice that `CslTxScheduler::HandleSentFrame` is reseting both CSL Tx
attempts and Indirect Tx attempts, so it makes sense to do the same
in `DataPollHandler::HandleSentFrame`.
This commit fixes the format string in logging functions.
When openthread is included in other projects that use the -Werror
option in their builds, such as Matter, these format string errors
appear. In this case, it can be seen in radio.h that the structure
members are uint32_t but printed with %u.
The size of types depends on the target, there needs to be a casing.
`LOCAL_EXPORT_CFLAGS` is exporting `OPENTHREAD_PROJECT_CFLAGS` which
contains quotes. This sometimes can cause compile errors due to
limitation of Android build system.
Also, `ot-cli` is repeating the flags in `LOCAL_CFLAGS`, which can
cause macro redefinition error. Since `ot-cli` depends on `ot-core`,
it already gets the flags from `LOCAL_EXPORT_CFLAGS`.
This commit contains smaller enhancements in `RouterTable` class:
- New method `FindNextHopOf()` is added to find the next hop of a
given router.
- Methods which find router are renamed: `FindRouterById()` to search
for a given Router ID, `FindRouterByRloc16()` to search for a given
RLOC16.
- The methods which find a neighbor router are declared as `private`
and only used by `friend` class `NeighborTable`. Other modules use
`NeighborTable` methods to find neighbors.
This commit updates `RoutingManager` to check if a change to xpanid
does impact the generated local on-link prefix. This can address two
situations: (1) when BR is started before Thread/MLE operation where
we can get a signal that xpanid is changed on MLE start (without it
actually changing), (2) if the xpanid does change but since not all
the xpanid bytes are used in the derivation of the local prefix, it
can remain as before.
This commit also updates the unit test to start the BR early (along
with MLE operation) under the `TestSavedOnLinkPrefixes()` case.
This commit updates the `RoutingManager` unit test to check that
there are no duplicate PIO/RIO prefixes in the emitted RA message.
It also updates the `TestSavedOnLinkPrefixes()` to check behavior
after device resets/restarts while it was advertising its local
on-link prefix or deprecating it.
This commit updates how UDP Encapsulation TLV is processed. In
particular, when handling a received TMF `kUriProxyTx` message
containing this TLV, we allow the TLV to be extended or not. This is
aligned with the Thread specification for this TLV. When appending
this TLV in `kUriProxyRx` TMF message, we continue to use Extended
TLV so to keep the behavior same as before.
This commit adds new private type `ParsedInfo` in `Tlv` class
which contains parsed TLV info such as TLV type, length, size,
value offset. This class provides `ParseFrom()` and `FindIn()`
methods to parse or find a TLV from a message.
This commit also adds a unit test `test_tlv` to validate the TLV
methods.
Add a Dependabot configuration that checks once a week if the GitHub
Actions are still using the latest version. If not, it opens a PR to
update them.
It will actually open few PRs, since only major versions are specified
(like v3), so only on a major release (like v4) it will update and
open a PR. But it helps actively keep GitHub Actions workflows up to
date and secure.
When adding a new spinel property or updating the existing spinel
property, it may cause the host can't work with the old RCP. The
host can be updated independently on some of our products. If the
compatibility issue happens, it causes the host dies after the
host is updated.
To reduce the compatibility issues between the host and RCP, this
commit updates the guideline of updating/adding RCP spinel properties.
This commit adds new methods in `Tlv` to read, find, or append simple
TLVs with a UTF8 string value. `StringTlvInfo<Type, kMaxStringLen>`
can be used to define constants and types for such TLVs. This helps
simplify implementation of many such TLVs, e.g., Vendor Name TLV,
Provisioning URL TLV, Network Name TLV, etc.
This commit updates `Mle` modules to use `FindTlvValueOffset()`
instead of `FindTlvOffset()` when trying to find a variable length
TLV (e.g., Network Data TLV or Address Registration TLV). This helps
simplify the code (we avoid reading the TLV again and can directly
read and process the TLV's value).
This commit simplifies `StateTlv` and updates the reading of TLV in
`DatasetManager::HandleMgmtSetResponse()` (which could previously
allow a TLV with empty value).