Commit Graph

9 Commits

Author SHA1 Message Date
Jason Zhang 0019f38839 [gtest] fix build error when building posix (#11289)
This commit fix build error when running "./script/cmake-build posix
-DOT_BUILD_GTEST=ON".
2025-02-25 22:28:58 -08:00
Yakun Xu 6fac4078b6 [test] cover src match handling (#11258)
This commit adds tests to cover the handling of Src Match entries,
including adding, removing and clearing of short addr entries and
extended addr entries.
2025-02-19 19:18:25 -08:00
Abtin Keshavarzian d1147d62b9 [trel] detect and handle socket addr discrepancy for TREL peers (#10869)
This commit introduces a new mechanism for the TREL link to detect and
handle discrepancies between the IPv6 address and port used by a TREL
peer in a received TREL packet, and the information previously
reported by the platform layer (through DNS-SD discovery) for the
same peer.

Ideally, the platform underlying DNS-SD should detect changes to
advertised ports and addresses by peers. However, there are
situations where this is not detected reliably.

As a received frame over the TREL radio link is processed by the MAC
or MLE layers, if the frame passes receive security checks at either
layer (indicating it is a secure and authenticated/fresh frame from a
valid neighbor), the TREL peer socket address is automatically
updated from the received TREL packet info. This ensures the TREL
peer table is updated correctly if there are changes to TREL peer
addresses of valid Thread neighbors upon rx from such neighbor,
increasing the robustness of the TREL link.

This commit also introduces a new `otPlatTrel` platform API,
`otPlatTrelNotifyPeerSocketAddressDifference()`. The TREL
implementation now notifies the platform layer whenever it detects a
discrepancy in a TREL peer's socket address, regardless of whether
the peer table is automatically updated. This allows the platform
layer to take any appropriate action, such as restarting or
confirming DNS-SD service resolution query for the peer service
instance and/or address resolution query for its associated host
name.

This commit also adds a new test that validates the newly added
behavior, including the auto-update of peer table information and
notification of the platform through the new API, triggered by either
MLE or MAC messages over the TREL radio link.
2024-12-18 20:35:58 -08:00
Zhanglong Xia c44538e4df [simulation] enable the platform assert (#10952)
When the ot-rcp enters the assert state, the host crashes and exits.
But the ot-rcp still runs in the dead loop and becomes an orphan
process.

This commit enables the platform assert so that the ot-rcp can
automatically exit when entering the assert state.
2024-11-22 16:48:51 -08:00
Yakun Xu 9277bce08e [spinel] add SPINEL_PROP_MAC_RX_AT (#10921)
This commit adds receive at functionality for spinel for host to
schedule reception on RCP.
2024-11-18 08:53:55 -08:00
Li Cao 8cb126ede8 [test] add implementation of otPlatRadioSetChannelTargetPower in FakePlatform (#10865) 2024-10-28 09:28:13 -07:00
Li Cao a225ee9c08 [test] add missing platform APIs in FakePlatform (#10844)
This commit adds some missing platform API implementation for
FakePlatform.

These are added so that FakePlatform can be used to write unit tests
in ot-br-posix.

The commit also guards the microSecondTimer code in `FakePlatform`
with the marcro `OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE` because
`otPlatAlarmMicroFired` is only defined in OT timer.cpp when
`OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE` is true.

This commit also removes some parameter names in the fake
implementation to avoid unused warnings.
2024-10-16 11:47:27 -07:00
Yakun Xu c4262af670 [test] verify behavior of RxChannelAfterTxDone (#10817)
This commit adds a test to verify RX channel is switched correctly after TX done.
2024-10-11 08:26:28 -07:00
Yakun Xu 8cb529be2a [test] add fake platform (#10594)
This commit adds a fake platform for unit/component tests. This platform
uses virtual time so it should be able to run fast.

Note that the fake platforms leverage C++ virtual methods to allow mocking.

This commit verifies setting active dataset triggers the active dataset
change event by the notifier.
2024-10-08 21:00:35 -07:00