public DeviceReportingRecipient(BacnetValue v0, BacnetValue v1, BacnetValue v2, BacnetValue v3, BacnetValue v4, BacnetValue v5, BacnetValue v6)
        {
            Id  = new BacnetObjectId();
            adr = null;

            WeekofDay = (BacnetBitString)v0.Value;
            fromTime  = (DateTime)v1.Value;
            toTime    = (DateTime)v2.Value;
            if (v3.Value is BacnetObjectId)
            {
                Id = (BacnetObjectId)v3.Value;
            }
            else
            {
                var netdescr = (BacnetValue[])v3.Value;
                var s        = (ushort)(uint)netdescr[0].Value;
                var b        = (byte[])netdescr[1].Value;
                adr = new BacnetAddress(BacnetAddressTypes.IP, s, b);
            }
            processIdentifier = (uint)v4.Value;
            Ack_Required      = (bool)v5.Value;
            evenType          = (BacnetBitString)v6.Value;
        }
Example #2
0
        public int Decode(byte[] buffer, int offset, uint count)
        {
            int len = 0;

            len++; //ignore apptag time ?
            len += ASN1.decode_bacnet_time(buffer, offset + len, out DateTime time);

            Time = new BacnetGenericTime(time, BacnetTimestampTags.TIME_STAMP_TIME);

            var tagLen = ASN1.decode_tag_number_and_value(buffer, offset + len, out BacnetApplicationTags tagNumber, out uint lenValueType);

            if (tagLen > 0)
            {
                len += tagLen;
                var decodeLen = ASN1.bacapp_decode_data(buffer, offset + len, offset + len + 1, tagNumber, lenValueType, out Value);
                len += decodeLen;
            }
            else
            {
                Value = new BacnetValue(BacnetApplicationTags.BACNET_APPLICATION_TAG_NULL, null);
            }

            return(len);
        }
Example #3
0
 public BacnetTimeValue(BacnetGenericTime time, BacnetValue value)
 {
     Time  = time;
     Value = value;
 }