Skip to content

Commit

Permalink
Remove top-level struct and enum support from IDL processing (#29511)
Browse files Browse the repository at this point in the history
* Start removing enums and structs from top level definitions in the parser

* Remove top level structs from matter idl auto-generation

* Fix generator type logic

* Update test inputs to move global structs

* Fix unit tests

* Restyle

* Remove unused import

---------

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
andy31415 and andreilitvin authored Sep 29, 2023
1 parent bc9f42e commit 8cb1bda
Show file tree
Hide file tree
Showing 84 changed files with 163 additions and 2,474 deletions.
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
32 changes: 0 additions & 32 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
32 changes: 0 additions & 32 deletions examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
32 changes: 0 additions & 32 deletions examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
server cluster OnOff = 6 {
enum DelayedAllOffEffectVariantEnum : ENUM8 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
32 changes: 0 additions & 32 deletions examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
// This IDL was generated automatically by ZAP.
// It is for view/code review purposes only.

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

struct ApplicationStruct {
int16u catalogVendorID = 0;
char_string applicationID = 1;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct LabelStruct {
char_string<16> label = 0;
char_string<16> value = 1;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
enum EffectIdentifierEnum : ENUM8 {
Expand Down
Loading

0 comments on commit 8cb1bda

Please sign in to comment.