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

Name conflict with attribute_t when using M5Unified library alongside Matter library #10804

Closed
1 task done
kyjibato opened this issue Jan 4, 2025 · 4 comments · Fixed by #10807
Closed
1 task done
Assignees
Labels
Area: Matter Issues and Feature Request about Matter Protocol Status: Solved Type: 3rd party Boards
Milestone

Comments

@kyjibato
Copy link

kyjibato commented Jan 4, 2025

Board

M5Stack Atom

Device Description

M5Stack Atom Lite

Hardware Configuration

No additional hardware attached besides the integrated sensors (M5Unit-ENV)

Version

v3.1.0

IDE Name

Arduino IDE

Operating System

macOS

Flash frequency

80 MHz

PSRAM enabled

no

Upload speed

115200

Description

When compiling an Arduino project that uses the Matter library (v3.1.0) together with M5Unified (v0.2.2) on M5Stack Atom, I encounter a compilation error caused by an ambiguous reference to attribute_t. It appears that the Matter library defines attribute_t in esp_matter_core.h, and M5Unified (via M5GFX) also declares attribute_t as an enum in enum.hpp.

Sketch

#include <M5Unified.h>
#include <Matter.h>

void setup() {
  M5.begin();
  Matter.begin();

  // ...
}

void loop() {
  M5.update();
  // ...
}

Debug Message

In file included from .../MatterGenericSwitch.h:20,
                 from .../Matter.h:22,
                 from src/main.cpp:23:
/.../MatterEndPoint.h:41:3: error: reference to 'attribute_t' is ambiguous
   41 |   attribute_t *getAttribute(uint32_t cluster_id, uint32_t attribute_id) {
      |   ^~~~~~~~~~~

... (multiple lines with similar 'attribute_t' is ambiguous errors) ...

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@kyjibato kyjibato added the Status: Awaiting triage Issue is waiting for triage label Jan 4, 2025
@me-no-dev
Copy link
Member

Please post this to the M5Unified repository. We can not make changes to matter on our end.

@SuGlider SuGlider self-assigned this Jan 5, 2025
@SuGlider
Copy link
Collaborator

SuGlider commented Jan 5, 2025

It is possible to change the function signature to return esp_matter::attribute_t using the proper qualifier in order to solve the ambiguity.

I'll add a PR and @kyjibato would be able to test it.

@SuGlider
Copy link
Collaborator

SuGlider commented Jan 5, 2025

@kyjibato - please test the PR #10807
It solves this issue.

@kyjibato
Copy link
Author

kyjibato commented Jan 6, 2025

@SuGlider Thank you for your hard work on PR #10807. I tested it in my environment, and it resolves the reported issue. I really appreciate your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Matter Issues and Feature Request about Matter Protocol Status: Solved Type: 3rd party Boards
Projects
Development

Successfully merging a pull request may close this issue.

3 participants