mirror of
https://github.com/espressif/openthread.git
synced 2026-08-05 02:17:47 +00:00
[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:
committed by
Jonathan Hui
parent
939ac82bf2
commit
2eab474025
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user