[spinel] make kTxWaitUs configurable during compile time (#9687)

It is useful in case RCP needs to wait for longer than the hardcoded
value in kTxWaitUs.
This commit is contained in:
parag-silabs
2023-12-06 17:42:37 -05:00
committed by GitHub
parent 8e1ce4bd4a
commit 6e7135e4e1
5 changed files with 18 additions and 2 deletions

View File

@ -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")
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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"

View File

@ -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"

View File

@ -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_

View File

@ -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);