diff --git a/Generator/ClusterGenerator.cs b/Generator/ClusterGenerator.cs
index f2eeb5b..92e9f23 100644
--- a/Generator/ClusterGenerator.cs
+++ b/Generator/ClusterGenerator.cs
@@ -37,7 +37,7 @@ public static void Generate()
if (cluster == null)
throw new IOException("Failed to parse cluster " + clusterxml);
if (!string.IsNullOrEmpty(cluster.clusterIds.clusterId.id))
- clusterBase.WriteLine($" case {cluster.name.Replace(" ", "").Replace('/', '_')}.CLUSTER_ID:\n return new {cluster.name.Replace(" ", "").Replace('/', '_')}(endPoint);");
+ clusterBase.WriteLine($" case {GeneratorUtil.SanitizeClassName(cluster.name)}.CLUSTER_ID:\n return new {GeneratorUtil.SanitizeClassName(cluster.name)}(endPoint);");
WriteClass(cluster);
}
}
@@ -95,7 +95,7 @@ private static void WriteClass(Cluster cluster, TextWriter writer)
if (string.IsNullOrEmpty(cluster.classification.baseCluster) && !string.IsNullOrEmpty(cluster.clusterIds.clusterId.id))
writer.WriteLine($" /// \n protected {GeneratorUtil.SanitizeClassName(cluster.name)}(uint cluster, ushort endPoint) : base(cluster, endPoint) {{ }}");
writer.WriteLine();
- if (cluster.dataTypes?.@enum != null || (cluster.features != null && cluster.features.Length > 0))
+ if (cluster.dataTypes?.@enum != null || cluster.dataTypes?.bitmap != null || (cluster.features != null && cluster.features.Length > 0))
{
writer.WriteLine(" #region Enums");
bool firstEnum=true;
@@ -174,7 +174,7 @@ private static void WriteClass(Cluster cluster, TextWriter writer)
WriteCommands(cluster, writer);
}
- if (cluster.attributes.Length > 0 || (cluster.features != null && cluster.features.Length > 0))
+ if ((cluster.attributes != null && cluster.attributes.Length > 0) || (cluster.features != null && cluster.features.Length > 0))
{
writer.WriteLine(" #region Attributes");
bool firstAttribute = true;
@@ -183,15 +183,18 @@ private static void WriteClass(Cluster cluster, TextWriter writer)
firstAttribute = false;
WriteFeatureFunctions(writer);
}
- foreach (var attribute in cluster.attributes)
+ if (cluster.attributes != null && cluster.attributes.Length > 0)
{
- if (attribute.type != null)
+ foreach (var attribute in cluster.attributes)
{
- if (firstAttribute)
- firstAttribute = false;
- else
- writer.WriteLine();
- WriteAttribute(cluster, attribute, writer);
+ if (attribute.type != null && attribute?.mandatoryConform?.condition?.name != "Zigbee")
+ {
+ if (firstAttribute)
+ firstAttribute = false;
+ else
+ writer.WriteLine();
+ WriteAttribute(cluster, attribute, writer);
+ }
}
}
writer.WriteLine(" #endregion Attributes");
@@ -231,7 +234,7 @@ private static void WriteStruct(clusterCommand command, bool toServer, TextWrite
if (field.type.EndsWith("Enum"))
writer.WriteLine(" = " + field.type + "." + field.@default + ";");
else
- writer.WriteLine(" = " + SanitizeDefault(field.@default, field.type) + ";");
+ writer.WriteLine(" = " + SanitizeDefault(field.@default, field.type, field.entry?.type) + ";");
}
else
writer.WriteLine();
@@ -375,6 +378,7 @@ private static void WriteStructType(bool optional, bool nullable, string type, s
case "namespace":
case "fabric-idx":
case "action-id":
+ case "percent":
writer.Write($"{totalIndent}writer.WriteByte({id}, {name}");
if (to != null)
writer.Write($", {to.Value}");
@@ -521,11 +525,13 @@ private static void WriteStructType(bool optional, bool nullable, string type, s
case "ref_IpAdr":
case "ref_Ipv4Adr":
case "ref_Ipv6Adr":
+ case "ipv6adr":
if (nullable && !optional)
writer.Write($"{totalIndent}if ({name} == null)\n{totalIndent} writer.WriteNull({id});\n{totalIndent}else\n ");
writer.WriteLine($"{totalIndent}writer.WriteBytes({id}, {name}.GetAddressBytes());");
return;
case "Hardware Address":
+ case "hwadr":
if (nullable && !optional)
writer.Write($"{totalIndent}if ({name} == null)\n{totalIndent} writer.WriteNull({id});\n{totalIndent}else\n ");
writer.WriteLine($"{totalIndent}writer.WriteBytes({id}, {name}.GetAddressBytes());");
@@ -623,6 +629,7 @@ private static void WriteFieldReader(bool optional, bool nullable, string type,
case "namespace":
case "fabric-idx":
case "action-id":
+ case "percent":
writer.Write($"reader.GetByte({id}");
break;
case "uint16":
@@ -672,9 +679,11 @@ private static void WriteFieldReader(bool optional, bool nullable, string type,
writer.WriteLine($"new IPAddress(reader.GetBytes({id}, {(optional ? "true" : "false")}, 4, 4{(id == "-1" || id == "i" ? ")!))" : ")!)")};");
return;
case "ref_Ipv6Adr":
+ case "ipv6adr":
writer.WriteLine($"new IPAddress(reader.GetBytes({id}, {(optional ? "true" : "false")}, 16, 16{(id == "-1" || id == "i" ? ")!))" : ")!)")};");
return;
case "Hardware Address":
+ case "hwadr":
writer.WriteLine($"new PhysicalAddress(reader.GetBytes({id}, {(optional ? "true" : "false")}, 8, 6{(id == "-1" || id == "i" ? ")!))" : ")!)")};");
return;
case "epoch-s":
@@ -764,7 +773,7 @@ private static void WriteFieldReader(bool optional, bool nullable, string type,
else if (id == "i")
writer.WriteLine("(reader.GetStruct(i)!));");
else
- writer.WriteLine($"fields[{id}]);");
+ writer.WriteLine($"((object[])fields[{id}]);");
}
return;
}
@@ -786,7 +795,7 @@ private static void WriteFieldReader(bool optional, bool nullable, string type,
private static bool HasEnum(Cluster cluster, string name)
{
- if (cluster.dataTypes.@enum == null)
+ if (cluster.dataTypes?.@enum == null)
return false;
foreach (clusterDataTypesEnum enumType in cluster.dataTypes.@enum)
{
@@ -798,7 +807,7 @@ private static bool HasEnum(Cluster cluster, string name)
private static bool HasEnumValue(Cluster cluster, string name, string value)
{
- if (cluster.dataTypes.@enum == null)
+ if (cluster.dataTypes?.@enum == null)
return false;
foreach (clusterDataTypesEnum enumType in cluster.dataTypes.@enum)
{
@@ -816,7 +825,7 @@ private static bool HasEnumValue(Cluster cluster, string name, string value)
private static bool HasBitmap(Cluster cluster, string name)
{
- if (cluster.dataTypes.bitmap == null)
+ if (cluster.dataTypes?.bitmap == null)
return false;
foreach (clusterDataTypesBitfield bitfieldType in cluster.dataTypes.bitmap)
{
@@ -828,7 +837,7 @@ private static bool HasBitmap(Cluster cluster, string name)
private static bool HasBitmapValue(Cluster cluster, string name, string value)
{
- if (cluster.dataTypes.bitmap == null)
+ if (cluster.dataTypes?.bitmap == null)
return false;
foreach (clusterDataTypesBitfield bitfieldType in cluster.dataTypes.bitmap)
{
@@ -846,7 +855,7 @@ private static bool HasBitmapValue(Cluster cluster, string name, string value)
private static bool HasStruct(Cluster cluster, string name)
{
- if (cluster.dataTypes.@struct == null)
+ if (cluster.dataTypes?.@struct == null)
return false;
foreach (clusterDataTypesStruct structType in cluster.dataTypes.@struct)
{
@@ -1024,7 +1033,7 @@ private static void WriteRecord(clusterDataTypesStruct structType, Cluster clust
if (HasEnum(cluster, field.type) || HasBitmap(cluster, field.type))
writer.WriteLine(" = " + field.type + "." + field.@default + ";");
else
- writer.WriteLine(" = " + SanitizeDefault(field.@default!, field.type) + ";");
+ writer.WriteLine(" = " + SanitizeDefault(field.@default!, field.type, field.entry?.type) + ";");
}
else
writer.WriteLine();
@@ -1079,9 +1088,12 @@ private static void WriteEnum(clusterDataTypesEnum enumType, TextWriter writer)
writer.WriteLine(" public enum " + GeneratorUtil.SanitizeName(enumType.name) + " {");
foreach (clusterDataTypesEnumItem item in enumType.item)
{
- if (item.summary != null)
- writer.WriteLine(" /// \n /// " + item.summary.Replace("[[ref_", "") + "\n /// ");
- writer.WriteLine(" " + item.name + " = " + item.value + ",");
+ if (!string.IsNullOrWhiteSpace(item.value))
+ {
+ if (item.summary != null)
+ writer.WriteLine(" /// \n /// " + item.summary.Replace("[[ref_", "") + "\n /// ");
+ writer.WriteLine(" " + GeneratorUtil.SanitizeName(item.name) + " = " + item.value + ",");
+ }
}
writer.WriteLine(" }");
}
@@ -1097,7 +1109,7 @@ private static void WriteBitfield(clusterDataTypesBitfield enumType, TextWriter
{
if (item.summary != null)
writer.WriteLine(" /// \n /// " + item.summary.Replace("[[ref_", "") + "\n /// ");
- writer.WriteLine(" " + item.name + " = " + (1<
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/ApplicationBasic.xml b/Generator/Clusters/ApplicationBasic.xml
new file mode 100644
index 0000000..dffdea1
--- /dev/null
+++ b/Generator/Clusters/ApplicationBasic.xml
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/ApplicationLauncher.xml b/Generator/Clusters/ApplicationLauncher.xml
new file mode 100644
index 0000000..e6dd0f1
--- /dev/null
+++ b/Generator/Clusters/ApplicationLauncher.xml
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/AudioOutput.xml b/Generator/Clusters/AudioOutput.xml
new file mode 100644
index 0000000..1faf674
--- /dev/null
+++ b/Generator/Clusters/AudioOutput.xml
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/BallastConfiguration.xml b/Generator/Clusters/BallastConfiguration.xml
new file mode 100644
index 0000000..f95fdd1
--- /dev/null
+++ b/Generator/Clusters/BallastConfiguration.xml
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/Binding-Cluster.xml b/Generator/Clusters/Binding-Cluster.xml
new file mode 100644
index 0000000..b3dbcb3
--- /dev/null
+++ b/Generator/Clusters/Binding-Cluster.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/BooleanState.xml b/Generator/Clusters/BooleanState.xml
new file mode 100644
index 0000000..481ac3b
--- /dev/null
+++ b/Generator/Clusters/BooleanState.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/BooleanStateConfiguration.xml b/Generator/Clusters/BooleanStateConfiguration.xml
new file mode 100644
index 0000000..668c6f8
--- /dev/null
+++ b/Generator/Clusters/BooleanStateConfiguration.xml
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/ConcentrationMeasurement.xml b/Generator/Clusters/ConcentrationMeasurement.xml
new file mode 100644
index 0000000..e10fd8c
--- /dev/null
+++ b/Generator/Clusters/ConcentrationMeasurement.xml
@@ -0,0 +1,264 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/DiagnosticsEthernet.xml b/Generator/Clusters/DiagnosticsEthernet.xml
new file mode 100644
index 0000000..d8784cf
--- /dev/null
+++ b/Generator/Clusters/DiagnosticsEthernet.xml
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/DiagnosticsSoftware.xml b/Generator/Clusters/DiagnosticsSoftware.xml
new file mode 100644
index 0000000..992a61e
--- /dev/null
+++ b/Generator/Clusters/DiagnosticsSoftware.xml
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/DiagnosticsThread.xml b/Generator/Clusters/DiagnosticsThread.xml
new file mode 100644
index 0000000..82cba98
--- /dev/null
+++ b/Generator/Clusters/DiagnosticsThread.xml
@@ -0,0 +1,700 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/DiagnosticsWiFi.xml b/Generator/Clusters/DiagnosticsWiFi.xml
new file mode 100644
index 0000000..ebbcd33
--- /dev/null
+++ b/Generator/Clusters/DiagnosticsWiFi.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/FanControl.xml b/Generator/Clusters/FanControl.xml
new file mode 100644
index 0000000..b139691
--- /dev/null
+++ b/Generator/Clusters/FanControl.xml
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/FlowMeasurement.xml b/Generator/Clusters/FlowMeasurement.xml
new file mode 100644
index 0000000..7df2761
--- /dev/null
+++ b/Generator/Clusters/FlowMeasurement.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/IlluminanceMeasurement.xml b/Generator/Clusters/IlluminanceMeasurement.xml
new file mode 100644
index 0000000..0440901
--- /dev/null
+++ b/Generator/Clusters/IlluminanceMeasurement.xml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/LowPower.xml b/Generator/Clusters/LowPower.xml
new file mode 100644
index 0000000..a7e0ec0
--- /dev/null
+++ b/Generator/Clusters/LowPower.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/NetworkCommissioningCluster.xml b/Generator/Clusters/NetworkCommissioningCluster.xml
new file mode 100644
index 0000000..aa45dbe
--- /dev/null
+++ b/Generator/Clusters/NetworkCommissioningCluster.xml
@@ -0,0 +1,513 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/OccupancySensing.xml b/Generator/Clusters/OccupancySensing.xml
new file mode 100644
index 0000000..2e3fc57
--- /dev/null
+++ b/Generator/Clusters/OccupancySensing.xml
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/Switch.xml b/Generator/Clusters/Switch.xml
new file mode 100644
index 0000000..1995226
--- /dev/null
+++ b/Generator/Clusters/Switch.xml
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/WakeOnLAN.xml b/Generator/Clusters/WakeOnLAN.xml
new file mode 100644
index 0000000..0481c0e
--- /dev/null
+++ b/Generator/Clusters/WakeOnLAN.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/WaterContentMeasurement.xml b/Generator/Clusters/WaterContentMeasurement.xml
new file mode 100644
index 0000000..0fbb6b4
--- /dev/null
+++ b/Generator/Clusters/WaterContentMeasurement.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/Clusters/bridge-clusters-ActionsCluster.xml b/Generator/Clusters/bridge-clusters-ActionsCluster.xml
new file mode 100644
index 0000000..a4ce24b
--- /dev/null
+++ b/Generator/Clusters/bridge-clusters-ActionsCluster.xml
@@ -0,0 +1,380 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Generator/GeneratorUtil.cs b/Generator/GeneratorUtil.cs
index 6b9d9ce..4740869 100644
--- a/Generator/GeneratorUtil.cs
+++ b/Generator/GeneratorUtil.cs
@@ -22,6 +22,8 @@ public static string SanitizeName(string name)
name = name.Substring(0, name.Length - 6);
bool cap = true;
StringBuilder ret = new StringBuilder(name.Length);
+ if (name.Length > 0 && Char.IsNumber(name[0]))
+ ret.Append('_');
foreach (char c in name)
{
if (c == ' ' || c == '-')
@@ -61,7 +63,7 @@ public static string FieldNameToComment(string name)
ret.Append(name[i]);
}
- return ret.ToString();
+ return ret.ToString().Replace("Wi Fi", "WiFi");
}
}
}
diff --git a/Generator/Schema/Cluster.cs b/Generator/Schema/Cluster.cs
index 30c4e57..d37f008 100644
--- a/Generator/Schema/Cluster.cs
+++ b/Generator/Schema/Cluster.cs
@@ -654,6 +654,53 @@ public string name
}
}
+ ///
+ [System.SerializableAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
+ public partial class attributeMandatoryConform
+ {
+
+ private attributeMandatoryConformCondition conditionField;
+
+ ///
+ public attributeMandatoryConformCondition condition
+ {
+ get
+ {
+ return this.conditionField;
+ }
+ set
+ {
+ this.conditionField = value;
+ }
+ }
+ }
+
+ ///
+ [System.SerializableAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
+ public partial class attributeMandatoryConformCondition
+ {
+
+ private string nameField;
+
+ ///
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string name
+ {
+ get
+ {
+ return this.nameField;
+ }
+ set
+ {
+ this.nameField = value;
+ }
+ }
+ }
+
///
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -661,7 +708,7 @@ public string name
public partial class clusterDataTypesBitfieldItem
{
- private object mandatoryConformField;
+ private attributeMandatoryConform mandatoryConformField;
private int bitField;
@@ -670,7 +717,7 @@ public partial class clusterDataTypesBitfieldItem
private string summaryField;
///
- public object mandatoryConform
+ public attributeMandatoryConform mandatoryConform
{
get
{
@@ -732,7 +779,7 @@ public string summary
public partial class clusterDataTypesEnumItem
{
- private object mandatoryConformField;
+ private attributeMandatoryConform mandatoryConformField;
private string valueField;
@@ -741,7 +788,7 @@ public partial class clusterDataTypesEnumItem
private string summaryField;
///
- public object mandatoryConform
+ public attributeMandatoryConform mandatoryConform
{
get
{
@@ -863,7 +910,7 @@ public partial class clusterDataTypesStructField
private clusterDataTypesStructFieldQuality qualityField;
- private object mandatoryConformField;
+ private attributeMandatoryConform mandatoryConformField;
private clusterDataTypesStructFieldConstraint constraintField;
@@ -915,7 +962,7 @@ public clusterDataTypesStructFieldQuality quality
}
///
- public object mandatoryConform
+ public attributeMandatoryConform mandatoryConform
{
get
{
@@ -1198,7 +1245,7 @@ public partial class clusterAttribute
private clusterAttributeQuality qualityField;
- private object mandatoryConformField;
+ private attributeMandatoryConform mandatoryConformField;
private clusterAttributeConstraint constraintField;
@@ -1252,7 +1299,7 @@ public clusterAttributeQuality quality
}
///
- public object mandatoryConform
+ public attributeMandatoryConform mandatoryConform
{
get
{
@@ -1438,7 +1485,7 @@ public partial class clusterAttributeAccess
private string readPrivilegeField;
- private bool writeField;
+ private string writeField;
private string writePrivilegeField;
@@ -1476,7 +1523,7 @@ public string readPrivilege
///
[System.Xml.Serialization.XmlAttributeAttribute()]
- public bool write
+ public string write
{
get
{
@@ -1765,7 +1812,7 @@ public partial class clusterCommand
private clusterCommandAccess accessField;
- private object mandatoryConformField;
+ private attributeMandatoryConform mandatoryConformField;
private clusterCommandField[] fieldField;
@@ -1804,7 +1851,7 @@ public clusterCommandAccess access
}
///
- public object mandatoryConform
+ public attributeMandatoryConform mandatoryConform
{
get
{
@@ -1992,7 +2039,7 @@ public partial class clusterCommandField
private object optionalConformField;
- private object mandatoryConformField;
+ private attributeMandatoryConform mandatoryConformField;
private object disallowConformField;
@@ -2048,7 +2095,7 @@ public object optionalConform
}
///
- public object mandatoryConform
+ public attributeMandatoryConform mandatoryConform
{
get
{
diff --git a/MatterDotNet/Clusters/Application/ActionsCluster.cs b/MatterDotNet/Clusters/Application/ActionsCluster.cs
new file mode 100644
index 0000000..ddc415b
--- /dev/null
+++ b/MatterDotNet/Clusters/Application/ActionsCluster.cs
@@ -0,0 +1,609 @@
+// MatterDotNet Copyright (C) 2025
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY, without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU Affero General Public License for more details.
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see .
+//
+// WARNING: This file was auto-generated. Do not edit.
+
+using MatterDotNet.Messages.InteractionModel;
+using MatterDotNet.Protocol.Parsers;
+using MatterDotNet.Protocol.Payloads;
+using MatterDotNet.Protocol.Sessions;
+using MatterDotNet.Protocol.Subprotocols;
+using System.Diagnostics.CodeAnalysis;
+
+namespace MatterDotNet.Clusters.Application
+{
+ ///
+ /// Actions Cluster
+ ///
+ [ClusterRevision(CLUSTER_ID, 1)]
+ public class ActionsCluster : ClusterBase
+ {
+ internal const uint CLUSTER_ID = 0x0025;
+
+ ///
+ /// Actions Cluster
+ ///
+ public ActionsCluster(ushort endPoint) : base(CLUSTER_ID, endPoint) { }
+ ///
+ protected ActionsCluster(uint cluster, ushort endPoint) : base(cluster, endPoint) { }
+
+ #region Enums
+ ///
+ /// Action Error
+ ///
+ public enum ActionErrorEnum {
+ ///
+ /// Other reason not listed in the row(s) below
+ ///
+ Unknown = 0,
+ ///
+ /// The action was interrupted by another command or interaction
+ ///
+ Interrupted = 1,
+ }
+
+ ///
+ /// Action State
+ ///
+ public enum ActionStateEnum {
+ ///
+ /// The action is not active
+ ///
+ Inactive = 0,
+ ///
+ /// The action is active
+ ///
+ Active = 1,
+ ///
+ /// The action has been paused
+ ///
+ Paused = 2,
+ ///
+ /// The action has been disabled
+ ///
+ Disabled = 3,
+ }
+
+ ///
+ /// Action Type
+ ///
+ public enum ActionTypeEnum {
+ ///
+ /// Use this only when none of the other values applies
+ ///
+ Other = 0,
+ ///
+ /// Bring the endpoints into a certain state
+ ///
+ Scene = 1,
+ ///
+ /// A sequence of states with a certain time pattern
+ ///
+ Sequence = 2,
+ ///
+ /// Control an automation (e.g. motion sensor controlling lights)
+ ///
+ Automation = 3,
+ ///
+ /// Sequence that will run when something doesn't happen
+ ///
+ Exception = 4,
+ ///
+ /// Use the endpoints to send a message to user
+ ///
+ Notification = 5,
+ ///
+ /// Higher priority notification
+ ///
+ Alarm = 6,
+ }
+
+ ///
+ /// Endpoint List Type
+ ///
+ public enum EndpointListTypeEnum {
+ ///
+ /// Another group of endpoints
+ ///
+ Other = 0,
+ ///
+ /// User-configured group of endpoints where an endpoint can be in only one room
+ ///
+ Room = 1,
+ ///
+ /// User-configured group of endpoints where an endpoint can be in any number of zones
+ ///
+ Zone = 2,
+ }
+
+ ///
+ /// Command Bits
+ ///
+ [Flags]
+ public enum CommandBits {
+ ///
+ /// Indicate support for InstantAction command
+ ///
+ InstantAction = 1,
+ ///
+ /// Indicate support for InstantActionWithTransition command
+ ///
+ InstantActionWithTransition = 2,
+ ///
+ /// Indicate support for StartAction command
+ ///
+ StartAction = 4,
+ ///
+ /// Indicate support for StartActionWithDuration command
+ ///
+ StartActionWithDuration = 8,
+ ///
+ /// Indicate support for StopAction command
+ ///
+ StopAction = 16,
+ ///
+ /// Indicate support for PauseAction command
+ ///
+ PauseAction = 32,
+ ///
+ /// Indicate support for PauseActionWithDuration command
+ ///
+ PauseActionWithDuration = 64,
+ ///
+ /// Indicate support for ResumeAction command
+ ///
+ ResumeAction = 128,
+ ///
+ /// Indicate support for EnableAction command
+ ///
+ EnableAction = 256,
+ ///
+ /// Indicate support for EnableActionWithDuration command
+ ///
+ EnableActionWithDuration = 512,
+ ///
+ /// Indicate support for DisableAction command
+ ///
+ DisableAction = 1024,
+ ///
+ /// Indicate support for DisableActionWithDuration command
+ ///
+ DisableActionWithDuration = 2048,
+ }
+ #endregion Enums
+
+ #region Records
+ ///
+ /// Action
+ ///
+ public record Action : TLVPayload {
+ ///
+ /// Action
+ ///
+ public Action() { }
+
+ [SetsRequiredMembers]
+ internal Action(object[] fields) {
+ FieldReader reader = new FieldReader(fields);
+ ActionID = reader.GetUShort(0)!.Value;
+ Name = reader.GetString(1, false)!;
+ Type = (ActionTypeEnum)reader.GetUShort(2)!.Value;
+ EndpointListID = reader.GetUShort(3)!.Value;
+ SupportedCommands = (CommandBits)reader.GetUShort(4)!.Value;
+ State = (ActionStateEnum)reader.GetUShort(5)!.Value;
+ }
+ public required ushort ActionID { get; set; }
+ public required string Name { get; set; }
+ public required ActionTypeEnum Type { get; set; }
+ public required ushort EndpointListID { get; set; }
+ public required CommandBits SupportedCommands { get; set; }
+ public required ActionStateEnum State { get; set; }
+ internal override void Serialize(TLVWriter writer, long structNumber = -1) {
+ writer.StartStructure(structNumber);
+ writer.WriteUShort(0, ActionID);
+ writer.WriteString(1, Name);
+ writer.WriteUShort(2, (ushort)Type);
+ writer.WriteUShort(3, EndpointListID);
+ writer.WriteUShort(4, (ushort)SupportedCommands);
+ writer.WriteUShort(5, (ushort)State);
+ writer.EndContainer();
+ }
+ }
+
+ ///
+ /// Endpoint List
+ ///
+ public record EndpointList : TLVPayload {
+ ///
+ /// Endpoint List
+ ///
+ public EndpointList() { }
+
+ [SetsRequiredMembers]
+ internal EndpointList(object[] fields) {
+ FieldReader reader = new FieldReader(fields);
+ EndpointListID = reader.GetUShort(0)!.Value;
+ Name = reader.GetString(1, false)!;
+ Type = (EndpointListTypeEnum)reader.GetUShort(2)!.Value;
+ {
+ Endpoints = new List();
+ foreach (var item in (List