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:
Jonathan Hui
2016-09-13 23:37:40 -07:00
committed by GitHub
parent fb823f4f72
commit ef2a1a0c9d
6 changed files with 78 additions and 0 deletions
+11
View File
@@ -111,6 +111,17 @@ void setChannel(uint8_t channel)
HWREG(RFCORE_XREG_FREQCTRL) = 11 + (channel - 11) * 5;
}
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
{
uint8_t *eui64 = (uint8_t *)IEEE_EUI64;
(void)aInstance;
for (uint8_t i = 0; i < OT_EXT_ADDRESS_SIZE; i++)
{
aIeeeEui64[i] = eui64[7 - i];
}
}
ThreadError otPlatRadioSetPanId(otInstance *aInstance, uint16_t panid)
{
ThreadError error = kThreadError_Busy;
+13
View File
@@ -260,6 +260,19 @@ static inline void getExtAddress(const uint8_t *frame, otExtAddress *address)
}
}
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
{
(void)aInstance;
aIeeeEui64[0] = 0x18;
aIeeeEui64[1] = 0xb4;
aIeeeEui64[2] = 0x30;
aIeeeEui64[3] = 0x00;
aIeeeEui64[4] = (NODE_ID >> 24) & 0xff;
aIeeeEui64[5] = (NODE_ID >> 16) & 0xff;
aIeeeEui64[6] = (NODE_ID >> 8) & 0xff;
aIeeeEui64[7] = NODE_ID & 0xff;
}
ThreadError otPlatRadioSetPanId(otInstance *aInstance, uint16_t panid)
{
ThreadError error = kThreadError_Busy;