[csl] add APIs to retrieve status (#8793)

This commit is contained in:
Martin Zimmermann
2023-07-01 13:42:22 -07:00
committed by GitHub
parent 96eb2a4386
commit 8081664d37
3 changed files with 29 additions and 5 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (338)
#define OPENTHREAD_API_VERSION (339)
/**
* @addtogroup api-instance
+24 -4
View File
@@ -1002,8 +1002,8 @@ void otLinkSetPcapCallback(otInstance *aInstance, otLinkPcapCallback aPcapCallba
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @retval true Promiscuous mode is enabled.
* @retval false Promiscuous mode is not enabled.
* @retval TRUE Promiscuous mode is enabled.
* @retval FALSE Promiscuous mode is not enabled.
*
*/
bool otLinkIsPromiscuous(otInstance *aInstance);
@@ -1121,12 +1121,32 @@ otError otLinkSetEnabled(otInstance *aInstance, bool aEnable);
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @retval true Link layer is enabled.
* @retval false Link layer is not enabled.
* @retval TRUE Link layer is enabled.
* @retval FALSE Link layer is not enabled.
*
*/
bool otLinkIsEnabled(otInstance *aInstance);
/**
* Indicates whether or not CSL is enabled.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @retval TRUE Link layer is CSL enabled.
* @retval FALSE Link layer is not CSL enabled.
*
*/
bool otLinkIsCslEnabled(otInstance *aInstance);
/**
* Indicates whether the device is connected to a parent which supports CSL.
*
* @retval TRUE If parent supports CSL.
* @retval FALSE If parent does not support CSL.
*
*/
bool otLinkIsCslSupported(otInstance *aInstance);
/**
* Instructs the device to send an empty IEEE 802.15.4 data frame.
*
+4
View File
@@ -391,6 +391,10 @@ uint16_t otLinkGetCcaFailureRate(otInstance *aInstance)
}
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
bool otLinkIsCslEnabled(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::Mac>().IsCslEnabled(); }
bool otLinkIsCslSupported(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::Mac>().IsCslSupported(); }
uint8_t otLinkCslGetChannel(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::Mac>().GetCslChannel(); }
otError otLinkCslSetChannel(otInstance *aInstance, uint8_t aChannel)