mirror of
https://github.com/espressif/openthread.git
synced 2026-10-16 12:47:38 +00:00
[instance] add otInstanceGetIndex() (#11197)
This commit is contained in:
@@ -52,7 +52,7 @@ extern "C" {
|
||||
*
|
||||
* @note This number versions both OpenThread platform and user APIs.
|
||||
*/
|
||||
#define OPENTHREAD_API_VERSION (485)
|
||||
#define OPENTHREAD_API_VERSION (486)
|
||||
|
||||
/**
|
||||
* @addtogroup api-instance
|
||||
@@ -114,6 +114,18 @@ otInstance *otInstanceInitSingle(void);
|
||||
*/
|
||||
otInstance *otInstanceInitMultiple(uint8_t aIdx);
|
||||
|
||||
/**
|
||||
* Gets the index of the OpenThread instance when multiple instance is in use.
|
||||
*
|
||||
* This function is available when both `OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE` and
|
||||
* `OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE` are enabled.
|
||||
*
|
||||
* @param[in] aInstance The reference of the OpenThread instance to get index.
|
||||
*
|
||||
* @returns The index of the OpenThread instance.
|
||||
*/
|
||||
uint8_t otInstanceGetIndex(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Gets the instance identifier.
|
||||
*
|
||||
|
||||
@@ -65,6 +65,7 @@ otInstance *otInstanceInitMultiple(uint8_t aIdx)
|
||||
|
||||
return instance;
|
||||
}
|
||||
uint8_t otInstanceGetIndex(otInstance *aInstance) { return Instance::GetIdx(AsCoreTypePtr(aInstance)); }
|
||||
#endif // OPENTHREAD_CONFIG_MULTIPLE_STATIC_INSTANCE_ENABLE
|
||||
otInstance *otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user