示例#1
0
        public Boolean Decode(BACPacket cm)
        {
            if (0 == cm.getNextByte().CompareTo(0x81))
            {
                function = (BVLL_IP_Fnct)cm.getNextByte();
                length   = cm.getNextByte();
                length   = (UInt16)(length << 4);
                length  += cm.getNextByte();
                cm.setLength(length);

                switch (function)
                {
                case BVLL_IP_Fnct.ORIGINAL_UNICAST_NPDU:
                    NPCI pic = new NPCI();
                    pic.Decode(cm);
                    inner = pic.ToString();
                    System.Console.WriteLine(ToString());
                    break;

                case BVLL_IP_Fnct.ORIGINAL_BROADCAST_NPDU:
                    NPCI pic1 = new NPCI();
                    pic1.Decode(cm);
                    inner = pic1.ToString();
                    System.Console.WriteLine(ToString());
                    break;

                default:
                    break;
                }
                return(true);
            }

            return(false);
        }