diff --git a/etc/cmake/options.cmake b/etc/cmake/options.cmake index 45e079dc529..5b2948acf46 100644 --- a/etc/cmake/options.cmake +++ b/etc/cmake/options.cmake @@ -325,6 +325,8 @@ ot_int_option(OT_RCP_RESTORATION_MAX_COUNT OPENTHREAD_SPINEL_CONFIG_RCP_RESTORAT # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +ot_int_option(OT_RCP_TX_WAIT_TIME_SECS OPENTHREAD_SPINEL_CONFIG_RCP_TX_WAIT_TIME_SECS "set RCP TX wait TIME in seconds") + if(NOT OT_EXTERNAL_MBEDTLS) set(OT_MBEDTLS mbedtls) target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=1") diff --git a/script/check-scan-build b/script/check-scan-build index ef723faad8a..7e6ad30ff55 100755 --- a/script/check-scan-build +++ b/script/check-scan-build @@ -69,6 +69,7 @@ OT_BUILD_OPTIONS=( "-DOT_PING_SENDER=ON" "-DOT_PLATFORM=external" "-DOT_RCP_RESTORATION_MAX_COUNT=2" + "-DOT_RCP_TX_WAIT_TIME_SECS=5" "-DOT_REFERENCE_DEVICE=ON" "-DOT_SERVICE=ON" "-DOT_SLAAC=ON" diff --git a/script/cmake-build b/script/cmake-build index e457bfcd1fd..97a8ba36de6 100755 --- a/script/cmake-build +++ b/script/cmake-build @@ -107,6 +107,7 @@ OT_POSIX_SIM_COMMON_OPTIONS=( "-DOT_SNTP_CLIENT=ON" "-DOT_SRP_CLIENT=ON" "-DOT_SRP_SERVER=ON" + "-DOT_RCP_TX_WAIT_TIME_SECS=5" "-DOT_UPTIME=ON" ) readonly OT_POSIX_SIM_COMMON_OPTIONS diff --git a/src/lib/spinel/openthread-spinel-config.h b/src/lib/spinel/openthread-spinel-config.h index 231a8683898..9da54ed8431 100644 --- a/src/lib/spinel/openthread-spinel-config.h +++ b/src/lib/spinel/openthread-spinel-config.h @@ -107,6 +107,15 @@ */ #ifndef OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_HEADER #define OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_HEADER "lib/spinel/example_vendor_hook.hpp" + +/** + * @def OPENTHREAD_SPINEL_CONFIG_RCP_TX_WAIT_TIME_SECS + * + * Defines the Tx wait duration in seconds. + * + */ +#ifndef OPENTHREAD_SPINEL_CONFIG_RCP_TX_WAIT_TIME_SECS +#define OPENTHREAD_SPINEL_CONFIG_RCP_TX_WAIT_TIME_SECS 5 #endif #endif // OPENTHREAD_SPINEL_CONFIG_H_ diff --git a/src/lib/spinel/radio_spinel.hpp b/src/lib/spinel/radio_spinel.hpp index bc0774d327e..b3fb0e59218 100644 --- a/src/lib/spinel/radio_spinel.hpp +++ b/src/lib/spinel/radio_spinel.hpp @@ -1107,7 +1107,7 @@ class RadioSpinel static constexpr uint32_t kUsPerMs = 1000; ///< Microseconds per millisecond. static constexpr uint64_t kTxWaitUs = - 5000000; ///< Maximum time of waiting for `TransmitDone` event, in microseconds. + OPENTHREAD_SPINEL_CONFIG_RCP_TX_WAIT_TIME_SECS * kUsPerMs * 1000; ///< Maximum time of waiting for `TransmitDone` event, in microseconds. typedef otError (RadioSpinel::*ResponseHandler)(const uint8_t *aBuffer, uint16_t aLength);