Skip to content

Commit

Permalink
Remove top-level struct and enum support from IDL processing (project…
Browse files Browse the repository at this point in the history
…-chip#29511)

* 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
2 people authored and HunsupJung committed Oct 23, 2023
1 parent dff17f0 commit a250bfd
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 a250bfd

Please sign in to comment.