[router-table] add documentation for {Get/Set}RouterIdRange() (#8532)

This commit is contained in:
Abtin Keshavarzian
2022-12-15 20:49:01 -08:00
committed by GitHub
parent 6e50af9b0e
commit 8ec9ede47a
3 changed files with 24 additions and 1 deletions
+3
View File
@@ -369,6 +369,9 @@ void otThreadSetThreadVersionCheckEnabled(otInstance *aInstance, bool aEnabled)
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
void otThreadGetRouterIdRange(otInstance *aInstance, uint8_t *aMinRouterId, uint8_t *aMaxRouterId)
{
AssertPointerIsNotNull(aMinRouterId);
AssertPointerIsNotNull(aMaxRouterId);
AsCoreType(aInstance).Get<RouterTable>().GetRouterIdRange(*aMinRouterId, *aMaxRouterId);
}
-1
View File
@@ -122,7 +122,6 @@ Router *RouterTable::Allocate(void)
VerifyOrExit(!mRouters.IsFull());
// count available router ids
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
for (uint8_t routerId = mMinRouterId; routerId <= mMaxRouterId; routerId++)
#else
+21
View File
@@ -314,8 +314,29 @@ public:
void HandleTimeTick(void);
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
/**
* This method gets the range of Router IDs.
*
* All the Router IDs in the range `[aMinRouterId, aMaxRouterId]` are allowed. This is intended for testing only.
*
* @param[out] aMinRouterId Reference to return the minimum Router ID.
* @param[out] aMaxRouterId Reference to return the maximum Router ID.
*
*/
void GetRouterIdRange(uint8_t &aMinRouterId, uint8_t &aMaxRouterId) const;
/**
* This method sets the range of Router IDs.
*
* All the Router IDs in the range `[aMinRouterId, aMaxRouterId]` are allowed. This is intended for testing only.
*
* @param[in] aMinRouterId The minimum Router ID.
* @param[in] aMaxRouterId The maximum Router ID.
*
* @retval kErrorNone Successfully set the Router ID range.
* @retval kErrorInvalidArgs The given range is not valid.
*
*/
Error SetRouterIdRange(uint8_t aMinRouterId, uint8_t aMaxRouterId);
#endif