mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 21:30:24 +00:00
When commissioning, set ext addr based on factory-assigned IEEE EUI-64. (#584)
- Add CLI for printing the factory-assigned IEEE EUI-64. - Add otPlatRadioGetIeeeEui64() API.
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
#include <common/encoding.hpp>
|
||||
#include <common/new.hpp>
|
||||
#include <net/ip6.hpp>
|
||||
#include <platform/radio.h>
|
||||
#include <platform/random.h>
|
||||
#include <platform/uart.h>
|
||||
|
||||
@@ -83,6 +84,7 @@ const struct Command Interpreter::sCommands[] =
|
||||
#endif
|
||||
{ "discover", &Interpreter::ProcessDiscover },
|
||||
{ "eidcache", &Interpreter::ProcessEidCache },
|
||||
{ "eui64", &Interpreter::ProcessEui64 },
|
||||
#ifdef OPENTHREAD_EXAMPLES_POSIX
|
||||
{ "exit", &Interpreter::ProcessExit },
|
||||
#endif
|
||||
@@ -546,6 +548,22 @@ exit:
|
||||
AppendResult(kThreadError_None);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessEui64(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otExtAddress extAddress;
|
||||
|
||||
VerifyOrExit(argc == 0, error = kThreadError_Parse);
|
||||
|
||||
otPlatRadioGetIeeeEui64(mInstance, extAddress.m8);
|
||||
OutputBytes(extAddress.m8, OT_EXT_ADDRESS_SIZE);
|
||||
sServer->OutputFormat("\r\n");
|
||||
|
||||
exit:
|
||||
(void)argv;
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessExtAddress(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
Reference in New Issue
Block a user