예제 #1
0
        public int Decode(byte[] buffer, int offset, uint count)
        {
            var len = 0;

            byte tagNumber;

            len += ASN1.decode_tag_number(buffer, offset + len, out tagNumber);

            switch (tagNumber)
            {
            case 0:
                var bdt = new BacnetDate();
                len  += bdt.Decode(buffer, offset + len, count);
                Entry = bdt;
                break;

            case 1:
                var bdr = new BacnetDateRange();
                len  += bdr.Decode(buffer, offset + len, count);
                Entry = bdr;
                len++;     // closing tag
                break;

            case 2:
                var bwd = new BacnetweekNDay();
                len  += bwd.Decode(buffer, offset + len, count);
                Entry = bwd;
                break;
            }

            return(len);
        }
예제 #2
0
        public int Decode(byte[] buffer, int offset, uint count)
        {
            var len = 0;

            Entries = new List <object>();

            while (true)
            {
                byte tagNumber;
                len += ASN1.decode_tag_number(buffer, offset + len, out tagNumber);

                switch (tagNumber)
                {
                case 0:
                    var bdt = new BacnetDate();
                    len += bdt.Decode(buffer, offset + len, count);
                    Entries.Add(bdt);
                    break;

                case 1:
                    var bdr = new BacnetDateRange();
                    len += bdr.Decode(buffer, offset + len, count);
                    Entries.Add(bdr);
                    len++;     // closing tag
                    break;

                case 2:
                    var bwd = new BacnetweekNDay();
                    len += bwd.Decode(buffer, offset + len, count);
                    Entries.Add(bwd);
                    break;

                default:
                    return(len - 1);  // closing Tag
                }
            }
        }
예제 #3
0
 public BacnetDateRange(BacnetDate start, BacnetDate end)
 {
     startDate = start;
     endDate   = end;
 }