mirror of
https://github.com/espressif/openthread.git
synced 2026-08-20 09:29:51 +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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user