Add support for setting preferred Router Id (#716)

This commit adds a new ot API to set preferred Router Id for the
node. Upon becoming a router/leader the node attempts to use the
preferred Router Id. If it is not set or if it can not be used,
a randomly generated Router Id is picked.
This commit is contained in:
Abtin Keshavarzian
2016-09-28 15:35:03 -07:00
committed by Jonathan Hui
parent 5b887f3a4e
commit d1c83d3625
4 changed files with 53 additions and 1 deletions
+17
View File
@@ -932,6 +932,23 @@ uint32_t otGetPollPeriod(otInstance *aInstance);
*/
void otSetPollPeriod(otInstance *aInstance, uint32_t aPollPeriod);
/**
* Set the preferred Router Id.
*
* Upon becoming a router/leader the node attempts to use this Router Id. If the
* preferred Router Id is not set or if it can not be used, a randomly generated
* router id is picked. This property can be set only when the device role is
* either detached or disabled.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aRouterId The preferred Router Id.
*
* @retval kThreadError_None Successfully set the preferred Router Id.
* @retval kThreadError_InvalidState Could not set (role is not detached or disabled)
*
*/
ThreadError otSetPreferredRouterId(otInstance *aInstance, uint8_t aRouterId);
/**
* @}
*/