Skip to content

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

Closed
@kyjibato

Description

@kyjibato

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.

Activity

me-no-dev

me-no-dev commented on Jan 4, 2025

@me-no-dev
Member

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

self-assigned this
on Jan 5, 2025
SuGlider

SuGlider commented on Jan 5, 2025

@SuGlider
Collaborator

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

SuGlider commented on Jan 5, 2025

@SuGlider
Collaborator

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

moved this from Todo to In Progress in Arduino ESP32 Core Project Roadmapon Jan 5, 2025
added this to the 3.1.0 milestone on Jan 5, 2025

5 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Name conflict with attribute_t when using M5Unified library alongside Matter library · Issue #10804 · espressif/arduino-esp32