Ejemplo n.º 1
0
            public void Decode(BACPacket cm)
            {
                p          = PRESENCES.EXIST;
                netNumber  = cm.getNextByte();
                netNumber *= 0x0100;
                netNumber += cm.getNextByte();
                adrLen     = cm.getNextByte();
                adr        = new byte[0];

                for (int x = 0; x < adrLen; x++)
                {
                    adr = adr.Concat(new byte[1] {
                        cm.getNextByte()
                    }).ToArray();
                }
            }
Ejemplo n.º 2
0
        public Boolean Decode(BACPacket cm)
        {
            pciVersion = cm.getNextByte(); // PIC Version is allways 0x01

            if (pciVersion != 0x01)
            {
                return(false);
            }

            byte picByt = cm.getNextByte();

            messageType    = this.DecodeMType(picByt);
            destPresent    = this.DecodeDestonation(picByt);
            srcPresent     = this.DecodeSource(picByt);
            expectingReply = this.DecodeExpectingReply(picByt);
            priority       = this.DecodePriority(picByt);

            //IF it contains the destonation addr get it
            if (destPresent == PRESENCES.EXIST)
            {
                destAddr.Decode(cm);
            }

            //IF it contains the source addr get it
            if (srcPresent == PRESENCES.EXIST)
            {
                srcAddr.Decode(cm);
            }

            //IF it contains the destonation don't forget the hop count
            if (destPresent == PRESENCES.EXIST)
            {
                hopCnt = cm.getNextByte();
            }

            if (messageType == MTYPE.APPICATION)
            {
                pdu = pdu.Decode(cm);
            }
            else
            {
                nsdu = nsdu.Decode(cm);
            }

            return(true);
        }
Ejemplo n.º 3
0
 public void setSrcPresent(PRESENCES a)
 {
     srcPresent = a;
 }
Ejemplo n.º 4
0
 public void setDestPresent(PRESENCES a)
 {
     destPresent = a;
 }