mirror of
https://github.com/espressif/openthread.git
synced 2026-09-13 12:40:05 +00:00
Dynamic Max Children (#462)
* Add support for dynamically adjusting the maximum number of allowed children. * Update cli to support max number of children.
This commit is contained in:
@@ -10,6 +10,7 @@ OpenThread test scripts use the CLI to execute test cases.
|
||||
* [channel](#channel)
|
||||
* [blacklist](#blacklist)
|
||||
* [child](#child)
|
||||
* [childmax](#childmax)
|
||||
* [childtimeout](#childtimeout)
|
||||
* [contextreusedelay](#contextreusedelay)
|
||||
* [counter](#counter)
|
||||
@@ -154,6 +155,25 @@ RSSI: -20
|
||||
Done
|
||||
```
|
||||
|
||||
### childmax
|
||||
|
||||
Get the Thread maximum number of allowed children.
|
||||
|
||||
```bash
|
||||
> childmax
|
||||
5
|
||||
Done
|
||||
```
|
||||
|
||||
### childmax \<count\>
|
||||
|
||||
Set the Thread maximum number of allowed children.
|
||||
|
||||
```bash
|
||||
> childmax 2
|
||||
Done
|
||||
```
|
||||
|
||||
### childtimeout
|
||||
|
||||
Get the Thread Child Timeout value.
|
||||
|
||||
@@ -57,6 +57,7 @@ const struct Command Interpreter::sCommands[] =
|
||||
{ "blacklist", &ProcessBlacklist },
|
||||
{ "channel", &ProcessChannel },
|
||||
{ "child", &ProcessChild },
|
||||
{ "childmax", &ProcessChildMax },
|
||||
{ "childtimeout", &ProcessChildTimeout },
|
||||
{ "contextreusedelay", &ProcessContextIdReuseDelay },
|
||||
{ "counter", &ProcessCounters },
|
||||
@@ -380,6 +381,25 @@ exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessChildMax(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
long value;
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
sServer->OutputFormat("%d\r\n", otGetMaxAllowedChildren());
|
||||
}
|
||||
else
|
||||
{
|
||||
SuccessOrExit(error = ParseLong(argv[0], value));
|
||||
SuccessOrExit(error = otSetMaxAllowedChildren(static_cast<uint8_t>(value)));
|
||||
}
|
||||
|
||||
exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessChildTimeout(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
@@ -134,6 +134,7 @@ private:
|
||||
static void ProcessChannel(int argc, char *argv[]);
|
||||
static void ProcessChild(int argc, char *argv[]);
|
||||
static void ProcessChildTimeout(int argc, char *argv[]);
|
||||
static void ProcessChildMax(int argc, char *argv[]);
|
||||
static void ProcessContextIdReuseDelay(int argc, char *argv[]);
|
||||
static void ProcessCounters(int argc, char *argv[]);
|
||||
static void ProcessDataset(int argc, char *argv[]);
|
||||
|
||||
Reference in New Issue
Block a user