/// <summary>
/// Sends Information Report Request.
/// </summary>
/// <param name="time">Send time.</param>
/// <param name="list">List of COSEM object and attribute index to report.</param>
/// <returns>Report request as byte array.</returns>
public byte[][] GenerateInformationReport(DateTime time, List <KeyValuePair <GXDLMSObject, int> > list)
{
if (list == null || list.Count == 0)
{
throw new ArgumentNullException("list");
}
GXByteBuffer buff = new GXByteBuffer();
byte[][] reply;
if (UseLogicalNameReferencing)
{
throw new Exception("Use GenerateEventNotification when Logical Name referencing is used.");
}
else
{
GXDLMSSNParameters p = new GXDLMSSNParameters(Settings, Command.InformationReport, list.Count, 0xFF, null, buff);
foreach (KeyValuePair <GXDLMSObject, int> it in list)
{
// Add variable type.
buff.SetUInt8(VariableAccessSpecification.VariableName);
int sn = it.Key.ShortName;
sn += (it.Value - 1) * 8;
buff.SetUInt16((UInt16)sn);
}
GXCommon.SetObjectCount(list.Count, buff);
foreach (KeyValuePair <GXDLMSObject, int> it in list)
{
AddData(it.Key, it.Value, buff);
}
reply = GXDLMS.GetSnMessages(p);
}
return(reply);
}