예제 #1
0
        public int error_encode_apdu(ref Byte[] apdu, Byte invoke_id, BACNET_CONFIRMED_SERVICE service, BACNET_ERROR_CLASS error_class, BACNET_ERROR_CODE error_code, int pos)
        {
            int apdu_len = 0;

            apdu[pos + 0] = (Byte)BACNET_PDU_TYPE.PDU_TYPE_ERROR;
            apdu[pos + 1] = invoke_id;
            apdu[pos + 2] = (Byte)service;
            apdu_len      = 3;
            apdu_len     += BasicalProcessor.Encode_Application_Enumerated(ref apdu, (uint)error_class, pos + apdu_len);
            apdu_len     += BasicalProcessor.Encode_Application_Enumerated(ref apdu, (uint)error_code, pos + apdu_len);
            return(apdu_len);
        }