mirror of
https://github.com/espressif/openthread.git
synced 2026-07-27 22:37:45 +00:00
[router-table] add documentation for {Get/Set}RouterIdRange() (#8532)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user