From 34767bd0c9e802db1f61ac246e6a1ce8a4daa33f Mon Sep 17 00:00:00 2001 From: Haerteleric Date: Fri, 2 Feb 2024 17:14:02 +0100 Subject: [PATCH] fixed wrong endian format of EUI64 --- src/OT-HAL/otPlatRadio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/OT-HAL/otPlatRadio.c b/src/OT-HAL/otPlatRadio.c index 4d19d96..787a25c 100755 --- a/src/OT-HAL/otPlatRadio.c +++ b/src/OT-HAL/otPlatRadio.c @@ -43,7 +43,14 @@ int8_t otPlatRadioGetReceiveSensitivity(otInstance *a_instance_p) void otPlatRadioGetIeeeEui64(otInstance *a_instance_p, uint8_t *a_ieeeEui64_p) { OT_UNUSED_VARIABLE(a_instance_p); - samr21Nvm_getIeeeAddr(a_ieeeEui64_p); + + uint8_t wrongEndianIeeeAddr[IEEE_15_4_EXTENDED_ADDR_SIZE]; + samr21Nvm_getIeeeAddr(wrongEndianIeeeAddr); + + for (unsigned int i = 0; i < IEEE_15_4_EXTENDED_ADDR_SIZE; i++) + { + a_ieeeEui64_p[IEEE_15_4_EXTENDED_ADDR_SIZE - 1 - i] = wrongEndianIeeeAddr[i]; + } } void otPlatRadioSetPanId(otInstance *a_instance_p, otPanId a_panId)