Example #1
0
        internal FileLastSegmentOrSection(ApplicationLayerParameters parameters, byte[] msg, int startIndex, bool isSequence)
            : base(parameters, msg, startIndex, isSequence)
        {
            if (!isSequence)
            {
                startIndex += parameters.SizeOfIOA; /* skip IOA */
            }
            if ((msg.Length - startIndex) < GetEncodedSize())
            {
                throw new ASDUParsingException("Message too small");
            }

            int nofValue;

            nofValue  = msg[startIndex++];
            nofValue += (msg[startIndex++] * 0x100);

            nof = (NameOfFile)nofValue;

            nameOfSection = msg[startIndex++];

            /* parse LSQ (last section or segment qualifier) */
            lsq = (LastSectionOrSegmentQualifier)msg[startIndex++];

            chs = msg[startIndex++];
        }
Example #2
0
 public FileLastSegmentOrSection(int objectAddress, NameOfFile nof, byte nameOfSection, LastSectionOrSegmentQualifier lsq, byte checksum)
     : base(objectAddress)
 {
     this.nof           = nof;
     this.nameOfSection = nameOfSection;
     this.lsq           = lsq;
     this.chs           = checksum;
 }