Gurux.DLMS.GXDLMS.MultipleBlocks C# (CSharp) Méthode

MultipleBlocks() private static méthode

Check is all data fit to one data block.
private static MultipleBlocks ( GXDLMSLNParameters p, GXByteBuffer reply, bool ciphering ) : void
p GXDLMSLNParameters LN parameters.
reply GXByteBuffer Generated reply.
ciphering bool
Résultat void
        private static void MultipleBlocks(GXDLMSLNParameters p, GXByteBuffer reply, bool ciphering)
        {
            //Check is all data fit to one message if data is given.
            int len = p.data.Size - p.data.Position;
            if (p.attributeDescriptor != null)
            {
                len += p.attributeDescriptor.Size;
            }
            if (ciphering)
            {
                len += CipheringHeaderSize;
            }
            if (!p.multipleBlocks)
            {
                //Add command type and invoke and priority.
                p.multipleBlocks = 2 + reply.Size + len > p.settings.MaxPduSize;
            }
            if (p.multipleBlocks)
            {
                //Add command type and invoke and priority.
                p.lastBlock = !(2 + reply.Size + len > p.settings.MaxPduSize);
            }
            if (p.lastBlock)
            {
                //Add command type and invoke and priority.
                p.lastBlock = !(2 + reply.Size + len > p.settings.MaxPduSize);
            }
        }