mirror of
https://github.com/espressif/openthread.git
synced 2026-09-15 21:50:08 +00:00
[mle] add discovery request callback (#5131)
This commit allows notifying the application a discovery request is received, which is useful if the application wants to be more active when a joiner comes.
This commit is contained in:
@@ -53,7 +53,7 @@ extern "C" {
|
||||
* @note This number versions both OpenThread platform and user APIs.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_API_VERSION (22)
|
||||
#define OPENTHREAD_API_VERSION (23)
|
||||
|
||||
/**
|
||||
* @addtogroup api-instance
|
||||
|
||||
@@ -805,6 +805,37 @@ void otThreadRegisterParentResponseCallback(otInstance * aInst
|
||||
otThreadParentResponseCallback aCallback,
|
||||
void * aContext);
|
||||
|
||||
/**
|
||||
* This structure represents the Thread Discovery Request data.
|
||||
*
|
||||
*/
|
||||
typedef struct otThreadDiscoveryRequestInfo
|
||||
{
|
||||
otExtAddress mExtAddress; ///< IEEE 802.15.4 Extended Address of the requester
|
||||
uint8_t mVersion : 4; ///< Thread version.
|
||||
bool mIsJoiner : 1; ///< Whether is from joiner.
|
||||
} otThreadDiscoveryRequestInfo;
|
||||
|
||||
/**
|
||||
* This function pointer is called every time an MLE Discovery Request message is received.
|
||||
*
|
||||
* @param[in] aInfo A pointer to the Discovery Request info data.
|
||||
* @param[in] aContext A pointer to callback application-specific context.
|
||||
*
|
||||
*/
|
||||
typedef void (*otThreadDiscoveryRequestCallback)(const otThreadDiscoveryRequestInfo *aInfo, void *aContext);
|
||||
|
||||
/**
|
||||
* This function sets a callback to receive MLE Discovery Request data.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aCallback A pointer to a function that is called upon receiving an MLE Discovery Request message.
|
||||
* @param[in] aContext A pointer to callback application-specific context.
|
||||
*
|
||||
*/
|
||||
void otThreadSetDiscoveryRequestCallback(otInstance * aInstnace,
|
||||
otThreadDiscoveryRequestCallback aCallback,
|
||||
void * aContext);
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user