Example #1
0
        internal bool Register(Lwm2mClient Client)
        {
            if (!this.shortServerId.IntegerValue.HasValue)
            {
                return(false);
            }

            Lwm2mSecurityObjectInstance SecurityInfo = Client.GetSecurityInfo(
                (ushort)this.shortServerId.IntegerValue.Value);

            if (SecurityInfo is null)
            {
                return(false);
            }

            Lwm2mServerReference Ref = SecurityInfo.GetServerReference(false);

            if (Ref is null)
            {
                return(false);
            }

            Client.Register(this.lifetimeSeconds.IntegerValue.HasValue ?
                            (int)this.lifetimeSeconds.IntegerValue.Value : 86400, Ref);

            return(true);
        }