Exemplo n.º 1
0
        public FIleWriteTransferCon(ApplicationLayerParameters parameters, byte[] msg, int startIndex) : base(parameters, msg, startIndex)
        {
            startIndex += 2; /* skip IOA */
            startIndex += 1; /* skip AdditionalPacketType */

            if ((msg.Length - startIndex) < GetEncodedSize())
            {
                throw new ASDUParsingException("Message too small");
            }

            startIndex += 1; /* skip OPT */

            _fileId  = msg[startIndex++];
            _fileId += msg[startIndex++] * 0x100;
            _fileId += msg[startIndex++] * 0x10000;
            _fileId += msg[startIndex++] * 0x1000000;

            _offset  = msg[startIndex++];
            _offset += msg[startIndex++] * 0x100;
            _offset += msg[startIndex++] * 0x10000;
            _offset += msg[startIndex++] * 0x1000000;

            _result = (WriteFileTransferConResult)msg[startIndex++];
        }
Exemplo n.º 2
0
 public FIleWriteTransferCon(int objectAddress, int fileId, int offset, WriteFileTransferConResult result) : base(objectAddress, AdditionalPacketType.FILE_TRANSFER, OptionID.WRITE_FILE_TRANSFER_CON)
 {
     _fileId = fileId;
     _offset = offset;
     _result = result;
 }