Gurux.DLMS.Objects.GXDLMSObject.ToLogicalName C# (CSharp) Méthode

ToLogicalName() static private méthode

Reserved for internal use.
static private ToLogicalName ( byte buff ) : string
buff byte
Résultat string
        internal static string ToLogicalName(byte[] buff)
        {
            if (buff.Length == 6)
            {
                return (buff[0] & 0xFF) + "." + (buff[1] & 0xFF) + "." + (buff[2] & 0xFF) + "." +
                       (buff[3] & 0xFF) + "." + (buff[4] & 0xFF) + "." + (buff[5] & 0xFF);
            }
            return "";
        }

Usage Example

 void IGXDLMSBase.SetValue(GXDLMSSettings settings, int index, object value)
 {
     if (index == 1)
     {
         if (value is string)
         {
             LogicalName = value.ToString();
         }
         else
         {
             LogicalName = GXDLMSClient.ChangeType((byte[])value, DataType.OctetString).ToString();
         }
     }
     else if (index == 2)
     {
         List <GXDLMSObjectDefinition> items = new List <GXDLMSObjectDefinition>();
         if (value != null)
         {
             foreach (Object[] it in (Object[])value)
             {
                 GXDLMSObjectDefinition item = new GXDLMSObjectDefinition();
                 item.ClassId     = (ObjectType)Convert.ToInt32(it[0]);
                 item.LogicalName = GXDLMSObject.ToLogicalName((byte[])it[1]);
                 items.Add(item);
             }
         }
         RegisterAssignment = items.ToArray();
     }
     else if (index == 3)
     {
         MaskList.Clear();
         if (value != null)
         {
             foreach (Object[] it in (Object[])value)
             {
                 List <byte> index_list = new List <byte>();
                 foreach (byte b in (Object[])it[1])
                 {
                     index_list.Add(b);
                 }
                 MaskList.Add(new KeyValuePair <byte[], byte[]>((byte[])it[0], index_list.ToArray()));
             }
         }
     }
     else if (index == 4)
     {
         if (value == null)
         {
             ActiveMask = null;
         }
         else
         {
             ActiveMask = (byte[])value;
         }
     }
     else
     {
         throw new ArgumentException("SetValue failed. Invalid attribute index.");
     }
 }
All Usage Examples Of Gurux.DLMS.Objects.GXDLMSObject::ToLogicalName