Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing GetPrimaryMACAddress(MutableByteSpan buf) in ConfigurationManagerImpl.h (CON-780) #645

Closed
jzwyssig opened this issue Sep 19, 2023 · 3 comments

Comments

@jzwyssig
Copy link

jzwyssig commented Sep 19, 2023

In the file esp-matter/connectedhomeip/connectedhomeip/src/platform/ESP32/ConfigurationManagerImpl.h only the function CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) override; is defined and as the name suggests support for Ethernet is missing.

Please add the generic definition CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) override; and provide a default implementation for Ethernet. I solved the problem by adding this definition and overriding the function in my main application with the correct MAC address of the used Ethernet chip.

Fix

#include <platform/internal/GenericConfigurationManagerImpl.ipp>
namespace chip {
namespace DeviceLayer {

using namespace ::chip::DeviceLayer::Internal;
CHIP_ERROR ConfigurationManagerImpl::GetPrimaryMACAddress(MutableByteSpan buf)
{ 
    uint8_t *byte_mac = get_mac_address_from_ethernet_chip();
    memcpy((void*)buf.data(), (void*)byte_mac, 6);
    return CHIP_NO_ERROR;
}

Environment

  • ESP-Matter Commit Id: 0a1d89d (up to date)
  • ESP-IDF Commit Id: e088c3766ba440e72268b458a68f27b6e7d63986 (5.1.1 stable)
  • SoC: ESP32-S3
  • Host Machine OS: Linux
  • Device Log: E (9141) chip[DIS]: Failed to get primary mac address of device. Generating a random one.
@github-actions github-actions bot changed the title Missing GetPrimaryMACAddress(MutableByteSpan buf) in ConfigurationManagerImpl.h Missing GetPrimaryMACAddress(MutableByteSpan buf) in ConfigurationManagerImpl.h (CON-780) Sep 19, 2023
@PSONALl
Copy link
Contributor

PSONALl commented Sep 22, 2023

@jzwyssig Yes you are right, I am implementing GetPrimaryMACAddress for ethernet. I will let you know once it is available

@dhrishi
Copy link
Collaborator

dhrishi commented Oct 13, 2023

Update -
@jzwyssig This is merged in upstream now: project-chip/connectedhomeip#29415
I will close this issue once the connectedhomeip submodule here is updated with the fix.

@jzwyssig
Copy link
Author

That is perfect, thank you @dhrishi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants