[ncp] use OT public link API to get factory-assigned EUI64 (#4047)

This commit changes the get handler for `SPINEL_PROP_HWADDR` to
use the public OT link API `otLinkGetFactoryAssignedIeeeEui64`
instead of the platform API. It also adds implementation of
this API under `OPENTREAD_RADIO` mode (for RCP build).
This commit is contained in:
Abtin Keshavarzian
2019-08-05 08:52:17 -07:00
committed by Jonathan Hui
parent 939ac82bf2
commit 2eab474025
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -260,6 +260,11 @@ uint16_t otLinkGetShortAddress(otInstance *aInstance)
return static_cast<Instance *>(aInstance)->Get<Mac::LinkRaw>().GetShortAddress();
}
void otLinkGetFactoryAssignedIeeeEui64(otInstance *aInstance, otExtAddress *aEui64)
{
otPlatRadioGetIeeeEui64(aInstance, aEui64->m8);
}
#endif // OPENTHREAD_RADIO
#endif // OPENTHREAD_RADIO || OPENTHREAD_CONFIG_LINK_RAW_ENABLE
+2 -1
View File
@@ -1947,7 +1947,8 @@ template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_POWER_STATE>(void)
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_HWADDR>(void)
{
otExtAddress hwAddr;
otPlatRadioGetIeeeEui64(mInstance, hwAddr.m8);
otLinkGetFactoryAssignedIeeeEui64(mInstance, &hwAddr);
return mEncoder.WriteEui64(hwAddr);
}