mirror of
https://github.com/espressif/openthread.git
synced 2025-08-06 14:52:18 +08:00
[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:
@ -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")
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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_
|
||||
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user