Beispiel #1
0
        private int Decode_Service_Request(ref Byte[] apdu, uint request_len, ref ACKNOWLEDGE_ALARM_DATA Ack_data)
        {
            int len = 0;

            int    section_length = 0;
            UInt32 value          = 0;

            /* tag 0 - processIdentifier */
            section_length = BasicalProcessor.Decode_Context_Unsigned(ref apdu, 0, ref Ack_data.ProcessIdentifier, len);
            len           += section_length;
            /* tag 1 - eventObjectIdentifier */
            section_length = BasicalProcessor.Decode_Object_Id(ref apdu, ref Ack_data.EventIdentifier.type, ref Ack_data.EventIdentifier.instance, len);
            len           += section_length;
            /* tag2  EventStare */
            section_length             = BasicalProcessor.Decode_Enumerated(ref apdu, 2, ref value, len);
            Ack_data.StateAcknowledged = (BACNET_EVENT_STATE)value;
            len += section_length;

            /* tag 3 - timeStamp */
            section_length = BasicalProcessor.Decode_Context_Timestamp(ref apdu, 3, ref Ack_data.TimeStamp, len);
            len           += section_length;
            /* tag 4 Acknowledgment Source */
            section_length = BasicalProcessor.Decode_Context_Character_String(ref apdu, 4, ref Ack_data.Source, len);
            len           += section_length;

            /* tag 5 - AcktimeStamp */
            section_length = BasicalProcessor.Decode_Context_Timestamp(ref apdu, 5, ref Ack_data.TimeOfAcknowledgment, len);
            len           += section_length;

            return(len);
        }