当前位置: 首页>>代码示例>>C#>>正文


C# GXDLMSSettings.ReceiverReady方法代码示例

本文整理汇总了C#中Gurux.DLMS.GXDLMSSettings.ReceiverReady方法的典型用法代码示例。如果您正苦于以下问题:C# GXDLMSSettings.ReceiverReady方法的具体用法?C# GXDLMSSettings.ReceiverReady怎么用?C# GXDLMSSettings.ReceiverReady使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gurux.DLMS.GXDLMSSettings的用法示例。


在下文中一共展示了GXDLMSSettings.ReceiverReady方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReceiverReady

 ///<summary>
 ///Generates an acknowledgment message, with which the server is informed to send next packets.
 ///</summary>
 ///<param name="type">
 /// Frame type.
 /// </param>
 ///<returns>
 ///Acknowledgment message as byte array.
 ///</returns>
 internal static byte[] ReceiverReady(GXDLMSSettings settings, RequestTypes type)
 {
     if (type == RequestTypes.None)
     {
         throw new ArgumentException("Invalid receiverReady RequestTypes parameter.");
     }
     // Get next frame.
     if ((type & RequestTypes.Frame) != 0)
     {
         byte id = settings.ReceiverReady();
         return GetHdlcFrame(settings, id, null);
     }
     Command cmd;
     if (settings.UseLogicalNameReferencing)
     {
         if (settings.IsServer)
         {
             cmd = Command.GetResponse;
         }
         else
         {
             cmd = Command.GetRequest;
         }
     }
     else
     {
         if (settings.IsServer)
         {
             cmd = Command.ReadResponse;
         }
         else
         {
             cmd = Command.ReadRequest;
         }
     }
     // Get next block.
     GXByteBuffer bb = new GXByteBuffer(6);
     if (settings.UseLogicalNameReferencing)
     {
         bb.SetUInt32(settings.BlockIndex);
     }
     else
     {
         bb.SetUInt16((UInt16)settings.BlockIndex);
     }
     settings.IncreaseBlockIndex();
     byte[][] reply;
     if (settings.UseLogicalNameReferencing)
     {
         GXDLMSLNParameters p = new GXDLMSLNParameters(settings, cmd, (byte)GetCommandType.NextDataBlock, bb, null, 0xff);
         reply = GXDLMS.GetLnMessages(p);
     }
     else
     {
         GXDLMSSNParameters p = new GXDLMSSNParameters(settings, cmd, 1, (byte)VariableAccessSpecification.BlockNumberAccess, bb, null);
         reply = GXDLMS.GetSnMessages(p);
     }
     return reply[0];
 }
开发者ID:Gurux,项目名称:Gurux.DLMS.Net,代码行数:68,代码来源:GXDLMS.cs


注:本文中的Gurux.DLMS.GXDLMSSettings.ReceiverReady方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。