protected string GetDataTypeClass(ZigBeeXmlAttribute attribute) { // if (attribute.implementationClass.isEmpty()) { if (ZclDataType.Mapping.ContainsKey(attribute.Type)) { return(ZclDataType.Mapping[attribute.Type].DataClass); } if (attribute.ImplementationClass != null && _dependencies.ContainsKey(attribute.ImplementationClass)) { // importsAdd(dependencies.get(type)); return(attribute.ImplementationClass); } Console.WriteLine("Unknown data type " + attribute.Type); return("(UNKNOWN::" + attribute.Type + ")"); // } // return attribute.implementationClass; }
private string DefineAttribute(ZigBeeXmlAttribute attribute, string clusterName, string attributeName, int count) { return("new ZclAttribute(this, " + GetEnum(attributeName) + ", \"" + attributeName + "\", " + "ZclDataType.Get(DataType." + attribute.Type + "), " + (!attribute.Optional).ToString().ToLower() + ", " + true.ToString().ToLower() + ", " + attribute.Writable.ToString().ToLower() + ", " + attribute.Reportable.ToString().ToLower() + ")"); }
protected void ImportsAddClass(ZigBeeXmlAttribute attribute) { ImportsAddClassInternal(GetDataTypeClass(attribute)); }