mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
254043deec
This commit introduces gRPC support to the Nexus simulator, enabling remote control and monitoring of simulations. This infrastructure allows external tools and visualizers to interact with the simulated network in real-time. Key changes: - Defined `simulation.proto` providing the `NexusService` definition for simulation control and event streaming. - Implemented `GrpcServer` in `nexus_grpc.cpp` which functions as a Nexus simulation observer, pushing events to connected clients. - Added RPCs for dynamic node creation, position updates, node state control, and network orchestration (forming and joining). - Implemented a real-time event stream that includes node state changes, link updates, and packet captures (with basic protocol decoding). - Introduced `nexus_native.cpp` as an entry point for a persistent simulation server that can be controlled via gRPC. - Updated `Core` and `Observer` interfaces to support a list of concurrent observers instead of a single instance. - Enhanced the CMake build system to optionally find and link against gRPC and Protobuf, including automatic source generation. - Updated CI (GitHub Actions) to include build and test steps for the new gRPC functionality. - Added comprehensive unit tests in `test_grpc.cpp` to verify all exposed gRPC service methods.