From 21b971c7e4cb64b2b1e814d3dfed346cd49f028d Mon Sep 17 00:00:00 2001 From: Krzysztof Bogucki Date: Wed, 21 Mar 2018 17:09:06 +0100 Subject: [PATCH] [nrf52840] custom EUI-64 get (#2631) --- examples/platforms/nrf52840/radio.c | 2 ++ src/core/openthread-core-default-config.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/examples/platforms/nrf52840/radio.c b/examples/platforms/nrf52840/radio.c index 4685e0163..9e5050b34 100644 --- a/examples/platforms/nrf52840/radio.c +++ b/examples/platforms/nrf52840/radio.c @@ -170,6 +170,7 @@ static inline void clearPendingEvents(void) } while (__STREXW(pendingEvents, (unsigned long volatile *)&sPendingEvents)); } +#if !OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64) { (void)aInstance; @@ -179,6 +180,7 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64) memcpy(aIeeeEui64, &factoryAddress, sizeof(factoryAddress)); } +#endif // OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId) { diff --git a/src/core/openthread-core-default-config.h b/src/core/openthread-core-default-config.h index ad08dee8d..b87c2e8c2 100644 --- a/src/core/openthread-core-default-config.h +++ b/src/core/openthread-core-default-config.h @@ -921,6 +921,16 @@ #define OPENTHREAD_CONFIG_ENABLE_PLATFORM_USEC_TIMER 0 #endif +/** + * @def OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE + * + * Allows to define custom otPlatRadioGetIeeeEui64 function to retrieve EUI-64. + * + */ +#ifndef OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE +#define OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE 0 +#endif + /** * @def OPENTHREAD_CONFIG_ENABLE_AUTO_START_SUPPORT *