Files
Yakun Xu 90224407f0 [radio] fix alternate short address initialization and matching (#13700)
When a router-eligible Child transitions to Router (e.g. during
TestCoapObserve when Leader notifies an upgraded child at its former
child RLOC16), OpenThread calls otPlatRadioSetAlternateShortAddress(),
which stores the previous short address in mRadioContext.mAlternateShortAddress.

Fix alternate short address handling consistently across Nexus,
simulation radio, and MAC frame utils:
- Advertise OT_RADIO_CAPS_ALT_SHORT_ADDR in both Nexus otPlatRadioGetCaps()
  and simulation gRadioCaps.
- Initialize mCslShortAddress, mShortAddress, and mAlternateShortAddress
  in otRadioContext to OT_RADIO_INVALID_SHORT_ADDR in both
  Nexus::Radio::Reset() and simulation platformRadioInit().
- Drop duplicate Radio::mShortAddress and Radio::mExtAddress from
  Nexus::Radio and use mRadioContext consistently.
- Simplify Nexus::Radio::Radio(void) to call Reset().
- Guard against Mac::kShortAddrInvalid and match both short addresses in
  Nexus::Radio::Matches() and otMacFrameDoesAddrMatchAny().
2026-10-09 23:21:19 -07:00
..
2023-06-28 08:54:23 -07:00

OpenThread Simulation on POSIX

This directory contains example platform drivers for simulation on POSIX.

Build Examples

$ cd <path-to-openthread>
$ mkdir build && cd build
$ cmake -GNinja -DOT_PLATFORM=simulation ..
$ ninja

After a successful build, the elf files are found in:

  • <path-to-openthread>/build/examples/apps/cli
  • <path-to-openthread>/build/examples/apps/ncp

Interact

  1. Spawn the process:
$ cd <path-to-openthread>/build/simulation/examples/apps/cli
$ ./ot-cli-ftd 1
  1. Type help for list of commands.
> help
help
channel
childtimeout
contextreusedelay
extaddr
extpanid
ipaddr
keysequence
leaderweight
mode
netdata register
networkidtimeout
networkkey
networkname
panid
ping
prefix
releaserouterid
rloc16
route
routerupgradethreshold
scan
start
state
stop