Gurux.DLMS.GXDLMSSNCommandHandler.FindSNObject C# (CSharp) Méthode

FindSNObject() static private méthode

static private FindSNObject ( GXDLMSObjectCollection items, int sn ) : GXSNInfo
items GXDLMSObjectCollection
sn int
Résultat GXSNInfo
        internal static GXSNInfo FindSNObject(GXDLMSObjectCollection items, int sn)
        {
            GXSNInfo i = new GXSNInfo();
            int offset, count;
            foreach (GXDLMSObject it in items)
            {
                if (sn >= it.ShortName)
                {
                    //If attribute is accessed.
                    if (sn < it.ShortName + (it as IGXDLMSBase).GetAttributeCount() * 8)
                    {
                        i.IsAction = false;
                        i.Item = it;
                        i.Index = ((sn - i.Item.ShortName) / 8) + 1;
                        break;
                    }
                    else
                    {
                        //If method is accessed.
                        GXDLMS.GetActionInfo(it.ObjectType, out offset, out count);
                        if (sn < it.ShortName + offset + (8 * count))
                        {
                            i.Item = it;
                            i.IsAction = true;
                            i.Index = (sn - it.ShortName - offset) / 8 + 1;
                            break;
                        }
                    }
                }
            }
            return i;
        }

Same methods

GXDLMSSNCommandHandler::FindSNObject ( GXDLMSServer server, int sn ) : GXSNInfo