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);
}
}