Skip to content

Commit

Permalink
[dns-sd] use extended MAC address for Thread device hostname (#6570)
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtdkp authored and pull[bot] committed Jun 15, 2021
1 parent 15b8cff commit 2389752
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/app/server/Mdns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ chip::ByteSpan FillMAC(uint8_t (&mac)[8])
{
memset(mac, 0, 8);
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
if (chip::DeviceLayer::ThreadStackMgr().GetFactoryAssignedEUI64(mac) == CHIP_NO_ERROR)
if (chip::DeviceLayer::ThreadStackMgr().GetPrimary802154MACAddress(mac) == CHIP_NO_ERROR)
{
ChipLogDetail(Discovery, "Using Thread MAC for hostname.");
ChipLogDetail(Discovery, "Using Thread extended MAC for hostname.");
return chip::ByteSpan(mac, 8);
}
#endif
Expand Down
6 changes: 0 additions & 6 deletions src/include/platform/ThreadStackManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class ThreadStackManager
CHIP_ERROR GetAndLogThreadTopologyMinimal();
CHIP_ERROR GetAndLogThreadTopologyFull();
CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf);
CHIP_ERROR GetFactoryAssignedEUI64(uint8_t (&buf)[8]);
CHIP_ERROR GetExternalIPv6Address(chip::Inet::IPAddress & addr);
CHIP_ERROR GetPollPeriod(uint32_t & buf);

Expand Down Expand Up @@ -327,11 +326,6 @@ inline CHIP_ERROR ThreadStackManager::GetPrimary802154MACAddress(uint8_t * buf)
return static_cast<ImplClass *>(this)->_GetPrimary802154MACAddress(buf);
}

inline CHIP_ERROR ThreadStackManager::GetFactoryAssignedEUI64(uint8_t (&buf)[8])
{
return static_cast<ImplClass *>(this)->_GetFactoryAssignedEUI64(buf);
}

inline CHIP_ERROR ThreadStackManager::GetExternalIPv6Address(chip::Inet::IPAddress & addr)
{
return static_cast<ImplClass *>(this)->_GetExternalIPv6Address(addr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class GenericConfigurationManagerImpl
CHIP_ERROR _GetPrimaryWiFiMACAddress(uint8_t * buf);
CHIP_ERROR _StorePrimaryWiFiMACAddress(const uint8_t * buf);
CHIP_ERROR _GetPrimary802154MACAddress(uint8_t * buf);
CHIP_ERROR _GetFactoryAssignedEUI64(uint8_t (&buf)[8]);
CHIP_ERROR _GetPollPeriod(uint32_t & buf);
CHIP_ERROR _StorePrimary802154MACAddress(const uint8_t * buf);
CHIP_ERROR _GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & dayOfMonth);
Expand Down
5 changes: 0 additions & 5 deletions src/platform/Linux/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,6 @@ CHIP_ERROR ThreadStackManagerImpl::_GetPrimary802154MACAddress(uint8_t * buf)
return OTBR_TO_CHIP_ERROR(error);
}

CHIP_ERROR ThreadStackManagerImpl::_GetFactoryAssignedEUI64(uint8_t (&buf)[8])
{
return CHIP_ERROR_NOT_IMPLEMENTED;
}

CHIP_ERROR ThreadStackManagerImpl::_GetExternalIPv6Address(chip::Inet::IPAddress & addr)
{
return CHIP_ERROR_NOT_IMPLEMENTED;
Expand Down
2 changes: 0 additions & 2 deletions src/platform/Linux/ThreadStackManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ class ThreadStackManagerImpl : public ThreadStackManager

CHIP_ERROR _GetPrimary802154MACAddress(uint8_t * buf);

CHIP_ERROR _GetFactoryAssignedEUI64(uint8_t (&buf)[8]);

CHIP_ERROR _GetExternalIPv6Address(chip::Inet::IPAddress & addr);

CHIP_ERROR _GetPollPeriod(uint32_t & buf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,15 +756,6 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::_GetPrimary80215
return CHIP_NO_ERROR;
}

template <class ImplClass>
CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::_GetFactoryAssignedEUI64(uint8_t (&buf)[8])
{
otExtAddress extendedAddr;
otLinkGetFactoryAssignedIeeeEui64(mOTInst, &extendedAddr);
memcpy(buf, extendedAddr.m8, sizeof(extendedAddr.m8));
return CHIP_NO_ERROR;
}

template <class ImplClass>
CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::_GetExternalIPv6Address(chip::Inet::IPAddress & addr)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class GenericThreadStackManagerImpl_OpenThread
CHIP_ERROR _GetAndLogThreadTopologyMinimal(void);
CHIP_ERROR _GetAndLogThreadTopologyFull(void);
CHIP_ERROR _GetPrimary802154MACAddress(uint8_t * buf);
CHIP_ERROR _GetFactoryAssignedEUI64(uint8_t (&buf)[8]);
CHIP_ERROR _GetExternalIPv6Address(chip::Inet::IPAddress & addr);
CHIP_ERROR _GetPollPeriod(uint32_t & buf);
void _OnWoBLEAdvertisingStart(void);
Expand Down

0 comments on commit 2389752

Please sign in to comment.