Esempio n. 1
0
        public static SmartAttributeCollection GetSmartRegisters(string textRegisters)
        {
            var collection = new SmartAttributeCollection();

            try {
                var splitOnCRLF = Resource.SmartAttributes.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                foreach (var line in splitOnCRLF)
                {
                    var    splitLineOnComma = line.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    string register         = splitLineOnComma[0].Trim();
                    string attributeName    = splitLineOnComma[1].Trim();

                    collection.Add(new SmartAttribute(Helper.ConvertStringHexToInt(register), attributeName));
                }
            } catch (Exception ex) {
                throw new Exception("GetSmartRegisters failed with error " + ex);
            }

            return(collection);
        }
Esempio n. 2
0
 public deviceModle()
 {
     SmartAttributes = new SmartAttributeCollection();
 }