mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
e2d07be235
This commit introduces the `SimulationObserver` interface and integrates it into the Nexus core simulation logic. This allows external systems to observe node state changes, link updates, and packet events in real-time. Key changes: - Defined `SimulationObserver` interface to handle node state changes, link updates, packet events, and event clearing. - Added `SetObserver` and `GetObserver` methods to the `Core` class. - Implemented `Core::HandleNeighborTableChanged` to notify the observer of neighbor additions and removals. - Implemented `Core::HandleStateChanged` to track node role transitions and parent changes, updating links accordingly. - Integrated packet event notification in `Core::ProcessRadio`, including basic destination node ID resolution for unicast frames. - Added `Core::SetNodeEnabled` to allow enabling or disabling Thread and MLE on specific nodes at runtime. - Updated `Core::Reset` to clear events via the observer. - Increased `OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS` to accommodate the new nexus state change handler. - Added `mLastParentId` to `Node` class to correctly manage link updates during parent switches or detachment.