diff --git a/src/core/mac/sub_mac.cpp b/src/core/mac/sub_mac.cpp index eaecd8410df..66399866624 100644 --- a/src/core/mac/sub_mac.cpp +++ b/src/core/mac/sub_mac.cpp @@ -139,6 +139,10 @@ otRadioCaps SubMac::GetCaps(void) const caps |= OT_RADIO_CAPS_RX_ON_WHEN_IDLE; #endif +#if OPENTHREAD_RADIO + caps |= OT_RADIO_CAPS_SLEEP_TO_TX; +#endif + #else caps = OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_CSMA_BACKOFF | OT_RADIO_CAPS_TRANSMIT_RETRIES | OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_TRANSMIT_SEC | OT_RADIO_CAPS_TRANSMIT_TIMING | diff --git a/tests/gtest/radio_spinel_rcp_test.cpp b/tests/gtest/radio_spinel_rcp_test.cpp index 4795ee48308..a5116b94b03 100644 --- a/tests/gtest/radio_spinel_rcp_test.cpp +++ b/tests/gtest/radio_spinel_rcp_test.cpp @@ -89,7 +89,6 @@ TEST(RadioSpinelTransmit, shouldPassDesiredTxPowerToRadioPlatform) .Times(1); ASSERT_EQ(platform.mRadioSpinel.Enable(FakePlatform::CurrentInstance()), kErrorNone); - ASSERT_EQ(platform.mRadioSpinel.Receive(11), kErrorNone); ASSERT_EQ(platform.mRadioSpinel.Transmit(txFrame), kErrorNone); platform.GoInMs(1000); @@ -129,7 +128,6 @@ TEST(RadioSpinelTransmit, shouldCauseSwitchingToRxChannelAfterTxDone) txFrame.mInfo.mTxInfo.mRxChannelAfterTxDone = 25; ASSERT_EQ(platform.mRadioSpinel.Enable(FakePlatform::CurrentInstance()), kErrorNone); - ASSERT_EQ(platform.mRadioSpinel.Receive(11), kErrorNone); ASSERT_EQ(platform.mRadioSpinel.Transmit(txFrame), kErrorNone); platform.GoInMs(1000); EXPECT_EQ(platform.GetReceiveChannel(), 25); @@ -186,7 +184,6 @@ TEST(RadioSpinelTransmit, shouldSkipCsmaCaWhenDisabled) EXPECT_CALL(platform, Receive(11)).Times(1); ASSERT_EQ(platform.mRadioSpinel.Enable(FakePlatform::CurrentInstance()), kErrorNone); - ASSERT_EQ(platform.mRadioSpinel.Receive(12), kErrorNone); ASSERT_EQ(platform.mRadioSpinel.Transmit(txFrame), kErrorNone); platform.GoInMs(1000); @@ -237,14 +234,12 @@ TEST(RadioSpinelTransmit, shouldPerformCsmaCaWhenEnabled) }))) .Times(1); - EXPECT_CALL(platform, Receive).Times(AnyNumber()); // Receive(11) will be called exactly twice: // 1. one time to prepare for TX because the fake platform doesn't support sleep-to-tx capability. // 2. one time in CSMA backoff because rx-on-when-idle is true. EXPECT_CALL(platform, Receive(11)).Times(2); ASSERT_EQ(platform.mRadioSpinel.Enable(FakePlatform::CurrentInstance()), kErrorNone); - ASSERT_EQ(platform.mRadioSpinel.Receive(12), kErrorNone); ASSERT_EQ(platform.mRadioSpinel.Transmit(txFrame), kErrorNone); platform.GoInMs(1000);