diff --git a/etc/cmake/options.cmake b/etc/cmake/options.cmake index 45e079dc5..b308283f9 100644 --- a/etc/cmake/options.cmake +++ b/etc/cmake/options.cmake @@ -322,6 +322,7 @@ ot_multi_option(OT_POWER_SUPPLY OT_POWER_SUPPLY_VALUES OPENTHREAD_CONFIG_DEVICE_ ot_int_option(OT_MLE_MAX_CHILDREN OPENTHREAD_CONFIG_MLE_MAX_CHILDREN "set maximum number of children") ot_int_option(OT_RCP_RESTORATION_MAX_COUNT OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT "set max RCP restoration count") +ot_int_option(OT_RCP_TX_WAIT_TIME_SECS OPENTHREAD_SPINEL_CONFIG_RCP_TX_WAIT_TIME_SECS "set RCP TX wait TIME in seconds") # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/script/check-scan-build b/script/check-scan-build index ef723faad..7e6ad30ff 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 e457bfcd1..5ed2e4e4b 100755 --- a/script/cmake-build +++ b/script/cmake-build @@ -102,6 +102,7 @@ OT_POSIX_SIM_COMMON_OPTIONS=( "-DOT_NETDIAG_CLIENT=ON" "-DOT_PING_SENDER=ON" "-DOT_RCP_RESTORATION_MAX_COUNT=2" + "-DOT_RCP_TX_WAIT_TIME_SECS=5" "-DOT_REFERENCE_DEVICE=ON" "-DOT_SERVICE=ON" "-DOT_SNTP_CLIENT=ON" diff --git a/src/lib/spinel/openthread-spinel-config.h b/src/lib/spinel/openthread-spinel-config.h index 231a86838..ef6d5abd2 100644 --- a/src/lib/spinel/openthread-spinel-config.h +++ b/src/lib/spinel/openthread-spinel-config.h @@ -109,4 +109,14 @@ #define OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_HEADER "lib/spinel/example_vendor_hook.hpp" #endif +/** + * @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 bc0774d32..dcac23e9e 100644 --- a/src/lib/spinel/radio_spinel.hpp +++ b/src/lib/spinel/radio_spinel.hpp @@ -1105,9 +1105,12 @@ private: kStateTransmitDone, ///< Radio indicated frame transmission is done. }; - static constexpr uint32_t kUsPerMs = 1000; ///< Microseconds per millisecond. + static constexpr uint32_t kUsPerMs = 1000; ///< Microseconds per millisecond. + static constexpr uint32_t kMsPerSec = 1000; ///< Milliseconds per second. + static constexpr uint32_t kUsPerSec = kUsPerMs * kMsPerSec; ///< Microseconds per second. static constexpr uint64_t kTxWaitUs = - 5000000; ///< Maximum time of waiting for `TransmitDone` event, in microseconds. + OPENTHREAD_SPINEL_CONFIG_RCP_TX_WAIT_TIME_SECS * + kUsPerSec; ///< Maximum time of waiting for `TransmitDone` event, in microseconds. typedef otError (RadioSpinel::*ResponseHandler)(const uint8_t *aBuffer, uint16_t aLength);