mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
202d5df96d
This commit implements CSL transmitter and receiver functionality in the Nexus simulation platform. It enables the necessary OpenThread configurations and provides the platform-level support for CSL. It also implements the otPlatRadioGetNow platform API to provide a high-resolution 64-bit microsecond time base, which is required for accurate CSL timing and synchronization. Changes: - Added GetNowMicro64() to Nexus::Core to expose the raw 64-bit microsecond timer. - Implemented otPlatRadioGetNow() in nexus_radio.cpp. - Enabled OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE and OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE in Nexus config. - Added otRadioContext to Nexus::Radio to track CSL parameters and manage security material for radio operations. - Implemented otPlatRadioEnableCsl, otPlatRadioResetCsl, otPlatRadioUpdateCslSampleTime, and otPlatRadioGetCslAccuracy. - Implemented otPlatRadioSetMacKey, otPlatRadioSetMacFrameCounter, and otPlatRadioSetAlternateShortAddress to keep radio context synchronized with OpenThread stack. - Updated otPlatRadioSetExtendedAddress and otPlatRadioEnableCsl to use AsCoreType for better readability and project conventions. - Moved Radio member initializations to the initializer list in its constructor. - Refactored radio SFD processing: moved otMacFrameProcessTxSfd and UpdateFcs from otPlatRadioTransmit (radio platform) to Core::ProcessRadio (simulation engine), ensuring CSL IEs and security headers are updated exactly when transmission starts. - Enhanced Nexus::Core::ProcessRadio to support generating Enhanced ACKs with CSL IEs for 802.15.4-2015 frames. - Updated Nexus and fuzz build systems to include necessary Nexus platform and utils headers/utilities.