mirror of
https://github.com/espressif/openthread.git
synced 2026-07-31 16:17:47 +00:00
Add Joiner UDP Port feature (#676)
* Add Joiner UDP Port feature - Add 'joinerport' cli for configuration - Include Joiner UDP Port TLV in discovery response message - Joiner use it as destination port during commissioning process
This commit is contained in:
@@ -95,6 +95,7 @@ const struct Command Interpreter::sCommands[] =
|
||||
#if OPENTHREAD_ENABLE_JOINER
|
||||
{ "joiner", &Interpreter::ProcessJoiner },
|
||||
#endif
|
||||
{ "joinerport", &Interpreter::ProcessJoinerPort },
|
||||
{ "keysequence", &Interpreter::ProcessKeySequence },
|
||||
{ "leaderdata", &Interpreter::ProcessLeaderData },
|
||||
{ "leaderpartitionid", &Interpreter::ProcessLeaderPartitionId },
|
||||
@@ -2206,6 +2207,25 @@ exit:
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_JOINER
|
||||
|
||||
void Interpreter::ProcessJoinerPort(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
long value;
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
sServer->OutputFormat("%d\r\n", otGetJoinerUdpPort(mInstance));
|
||||
}
|
||||
else
|
||||
{
|
||||
SuccessOrExit(error = ParseLong(argv[0], value));
|
||||
error = otSetJoinerUdpPort(mInstance, static_cast<uint16_t>(value));
|
||||
}
|
||||
|
||||
exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessWhitelist(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
Reference in New Issue
Block a user