mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 19:27:46 +00:00
[spinel] add capability definitions for FTD, MTD, RADIO configuration (#3357)
This commit adds new spinel capability definitions to specify the FTD, MTD or RADIO build configurations. Depending on the OpenThread build configurations the corresponding capability is included in `SPINEL_PROP_CAPS` list.
This commit is contained in:
committed by
Jonathan Hui
parent
c06179938c
commit
f189cafcc7
@@ -1724,6 +1724,14 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_CAPS>(void)
|
||||
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_MCU_POWER_STATE));
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CONFIG_FTD));
|
||||
#elif OPENTHREAD_MTD
|
||||
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CONFIG_MTD));
|
||||
#elif OPENTHREAD_RADIO
|
||||
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CONFIG_RADIO));
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_RADIO || OPENTHREAD_ENABLE_RAW_LINK_API
|
||||
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_MAC_RAW));
|
||||
#endif
|
||||
|
||||
@@ -2411,6 +2411,18 @@ const char *spinel_capability_to_cstr(unsigned int capability)
|
||||
ret = "802_15_4_868MHZ_ASK";
|
||||
break;
|
||||
|
||||
case SPINEL_CAP_CONFIG_FTD:
|
||||
ret = "CONFIG_FTD";
|
||||
break;
|
||||
|
||||
case SPINEL_CAP_CONFIG_MTD:
|
||||
ret = "CONFIG_MTD";
|
||||
break;
|
||||
|
||||
case SPINEL_CAP_CONFIG_RADIO:
|
||||
ret = "CONFIG_RADIO";
|
||||
break;
|
||||
|
||||
case SPINEL_CAP_ROLE_ROUTER:
|
||||
ret = "ROLE_ROUTER";
|
||||
break;
|
||||
|
||||
@@ -740,6 +740,12 @@ enum
|
||||
SPINEL_CAP_802_15_4_868MHZ_ASK = (SPINEL_CAP_802_15_4__BEGIN + 14),
|
||||
SPINEL_CAP_802_15_4__END = 32,
|
||||
|
||||
SPINEL_CAP_CONFIG__BEGIN = 32,
|
||||
SPINEL_CAP_CONFIG_FTD = (SPINEL_CAP_CONFIG__BEGIN + 0),
|
||||
SPINEL_CAP_CONFIG_MTD = (SPINEL_CAP_CONFIG__BEGIN + 1),
|
||||
SPINEL_CAP_CONFIG_RADIO = (SPINEL_CAP_CONFIG__BEGIN + 2),
|
||||
SPINEL_CAP_CONFIG__END = 40,
|
||||
|
||||
SPINEL_CAP_ROLE__BEGIN = 48,
|
||||
SPINEL_CAP_ROLE_ROUTER = (SPINEL_CAP_ROLE__BEGIN + 0),
|
||||
SPINEL_CAP_ROLE_SLEEPY = (SPINEL_CAP_ROLE__BEGIN + 1),
|
||||
|
||||
Reference in New Issue
Block a user