Example #1
0
        public int ASN1decode(byte[] buffer, int offset, uint len_value)
        {
            int  len = 0;
            byte tag_number;

            Entries = new List <object>();

            for (;;)
            {
                byte b = buffer[offset + len];
                len += ASN1.decode_tag_number(buffer, offset + len, out tag_number);

                switch (tag_number)
                {
                case 0:
                    BacnetDate bdt = new BacnetDate();
                    len += bdt.ASN1decode(buffer, offset + len, len_value);
                    Entries.Add(bdt);
                    break;

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

                case 2:
                    BacnetweekNDay bwd = new BacnetweekNDay();
                    len += bwd.ASN1decode(buffer, offset + len, len_value);
                    Entries.Add(bwd);
                    break;

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