mirror of
https://github.com/espressif/openthread.git
synced 2026-08-21 01:49:52 +00:00
[link] fix link raw caps calculation (#2668)
Allow software implementations of link layer features even when hardware supports.
This commit is contained in:
@@ -157,18 +157,24 @@ otRadioCaps LinkRaw::GetCaps(void) const
|
||||
// time included into the raw link-layer code.
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT
|
||||
assert((RadioCaps & OT_RADIO_CAPS_ACK_TIMEOUT) == 0);
|
||||
RadioCaps = static_cast<otRadioCaps>(RadioCaps | OT_RADIO_CAPS_ACK_TIMEOUT);
|
||||
if ((RadioCaps & OT_RADIO_CAPS_ACK_TIMEOUT) == 0)
|
||||
{
|
||||
RadioCaps = static_cast<otRadioCaps>(RadioCaps | OT_RADIO_CAPS_ACK_TIMEOUT);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT
|
||||
assert((RadioCaps & OT_RADIO_CAPS_TRANSMIT_RETRIES) == 0);
|
||||
RadioCaps = static_cast<otRadioCaps>(RadioCaps | OT_RADIO_CAPS_TRANSMIT_RETRIES);
|
||||
if ((RadioCaps & OT_RADIO_CAPS_TRANSMIT_RETRIES) == 0)
|
||||
{
|
||||
RadioCaps = static_cast<otRadioCaps>(RadioCaps | OT_RADIO_CAPS_TRANSMIT_RETRIES);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN
|
||||
assert((RadioCaps & OT_RADIO_CAPS_ENERGY_SCAN) == 0);
|
||||
RadioCaps = static_cast<otRadioCaps>(RadioCaps | OT_RADIO_CAPS_ENERGY_SCAN);
|
||||
if ((RadioCaps & OT_RADIO_CAPS_ENERGY_SCAN) == 0)
|
||||
{
|
||||
RadioCaps = static_cast<otRadioCaps>(RadioCaps | OT_RADIO_CAPS_ENERGY_SCAN);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN
|
||||
|
||||
return RadioCaps;
|
||||
|
||||
Reference in New Issue
Block a user