示例#1
0
        public static IntegerResources Deserialise(TlvReader reader)
        {
            IntegerResources result = null;

            if (reader.TlvRecord == null)
            {
                reader.Read();
            }
            if (reader.TlvRecord != null)
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.MultipleResources)
                {
                    result = new IntegerResources(reader.TlvRecord.Identifier.ToString());
                    if (reader.TlvRecord.Value != null)
                    {
                        using (TlvReader childReader = new TlvReader(reader.TlvRecord.Value))
                        {
                            while (childReader.Read())
                            {
                                if (childReader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ResourceInstance)
                                {
                                    IntegerResource childResource = new IntegerResource(childReader.TlvRecord.Identifier.ToString());
                                    childResource.Value = childReader.TlvRecord.ValueAsInt64();
                                    result.Add(childResource);
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.Package:
                        this.Package = reader.TlvRecord.Value;
                        result       = true;
                        break;

                    case ResourceID.PackageURI:
                        this.PackageURI = reader.TlvRecord.ValueAsString();
                        result          = true;
                        break;

                    case ResourceID.State:
                        this.State = reader.TlvRecord.ValueAsInt64();
                        result     = true;
                        break;

                    case ResourceID.UpdateSupportedObjects:
                        this.UpdateSupportedObjects = reader.TlvRecord.ValueAsBoolean();
                        result = true;
                        break;

                    case ResourceID.UpdateResult:
                        this.UpdateResult = reader.TlvRecord.ValueAsInt64();
                        result            = true;
                        break;

                    case ResourceID.PackageName:
                        this.PackageName = reader.TlvRecord.ValueAsString();
                        result           = true;
                        break;

                    case ResourceID.PackageVersion:
                        this.PackageVersion = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
示例#3
0
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.Latitude:
                        this.Latitude = reader.TlvRecord.ValueAsString();
                        result        = true;
                        break;

                    case ResourceID.Longitude:
                        this.Longitude = reader.TlvRecord.ValueAsString();
                        result         = true;
                        break;

                    case ResourceID.Altitude:
                        this.Altitude = reader.TlvRecord.ValueAsString();
                        result        = true;
                        break;

                    case ResourceID.Uncertainty:
                        this.Uncertainty = reader.TlvRecord.ValueAsString();
                        result           = true;
                        break;

                    case ResourceID.Velocity:
                        this.Velocity = reader.TlvRecord.Value;
                        result        = true;
                        break;

                    case ResourceID.Timestamp:
                        this.Timestamp = reader.TlvRecord.ValueAsDateTime();
                        result         = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
示例#4
0
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.Property:
                        this.Property = reader.TlvRecord.ValueAsString();
                        result        = true;
                        break;

                    case ResourceID.Group:
                        this.Group = reader.TlvRecord.ValueAsInt64();
                        result     = true;
                        break;

                    case ResourceID.Description:
                        this.Description = reader.TlvRecord.ValueAsString();
                        result           = true;
                        break;

                    case ResourceID.Attached:
                        this.Attached = reader.TlvRecord.ValueAsBoolean();
                        result        = true;
                        break;

                    case ResourceID.Enabled:
                        this.Enabled = reader.TlvRecord.ValueAsBoolean();
                        result       = true;
                        break;

                    case ResourceID.NotifyEn:
                        this.NotifyEn = reader.TlvRecord.ValueAsBoolean();
                        result        = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
示例#5
0
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.SMSTxCounter:
                        this.SMSTxCounter = reader.TlvRecord.ValueAsInt64();
                        result            = true;
                        break;

                    case ResourceID.SMSRxCounter:
                        this.SMSRxCounter = reader.TlvRecord.ValueAsInt64();
                        result            = true;
                        break;

                    case ResourceID.TxData:
                        this.TxData = reader.TlvRecord.ValueAsInt64();
                        result      = true;
                        break;

                    case ResourceID.RxData:
                        this.RxData = reader.TlvRecord.ValueAsInt64();
                        result      = true;
                        break;

                    case ResourceID.MaxMessageSize:
                        this.MaxMessageSize = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.AverageMessageSize:
                        this.AverageMessageSize = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.ShortServerID:
                        this.ShortServerID = reader.TlvRecord.ValueAsInt64();
                        result             = true;
                        break;

                    case ResourceID.Lifetime:
                        this.Lifetime = reader.TlvRecord.ValueAsInt64();
                        result        = true;
                        break;

                    case ResourceID.DefaultMinimumPeriod:
                        this.DefaultMinimumPeriod = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.DefaultMaximumPeriod:
                        this.DefaultMaximumPeriod = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.DisableTimeout:
                        this.DisableTimeout = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.NotificationStoringWhenDisabledorOffline:
                        this.NotificationStoringWhenDisabledorOffline = reader.TlvRecord.ValueAsBoolean();
                        result = true;
                        break;

                    case ResourceID.Binding:
                        this.Binding = reader.TlvRecord.ValueAsString();
                        result       = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.URL:
                        this.URL = reader.TlvRecord.ValueAsString();
                        result   = true;
                        break;

                    case ResourceID.CustomerKey:
                        this.CustomerKey = reader.TlvRecord.ValueAsString();
                        result           = true;
                        break;

                    case ResourceID.CustomerSecret:
                        this.CustomerSecret = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.RememberMeToken:
                        this.RememberMeToken = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.RememberMeTokenExpiry:
                        this.RememberMeTokenExpiry = reader.TlvRecord.ValueAsDateTime();
                        result = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
示例#8
0
        public static bool Deserialise(TlvReader reader, BooleanResource item)
        {
            bool result = false;

            if (reader.TlvRecord == null)
            {
                reader.Read();
            }
            if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ResourceWithValue)
            {
                item.Value = reader.TlvRecord.ValueAsBoolean();
                result     = true;
            }
            return(result);
        }
示例#9
0
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.ObjectID:
                        this.ObjectID = reader.TlvRecord.ValueAsInt64();
                        result        = true;
                        break;

                    case ResourceID.ObjectInstanceID:
                        this.ObjectInstanceID = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.ACLs:
                        this.ACLs = IntegerResources.Deserialise(reader);
                        result    = true;
                        break;

                    case ResourceID.AccessControlOwner:
                        this.AccessControlOwner = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
示例#10
0
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.ShortServerID:
                        this.ShortServerID = reader.TlvRecord.ValueAsInt32();
                        result             = true;
                        break;

                    case ResourceID.Lifetime:
                        this.Lifetime = reader.TlvRecord.ValueAsInt32();
                        result        = true;
                        break;

                    case ResourceID.DefaultMinimumPeriod:
                        this.DefaultMinimumPeriod = reader.TlvRecord.ValueAsInt32();
                        result = true;
                        break;

                    case ResourceID.DefaultMaximumPeriod:
                        this.DefaultMaximumPeriod = reader.TlvRecord.ValueAsInt32();
                        result = true;
                        break;

                    case ResourceID.DisableTimeout:
                        this.DisableTimeout = reader.TlvRecord.ValueAsInt32();
                        result = true;
                        break;

                    case ResourceID.NotificationStoringWhenOffline:
                        this.NotificationStoringWhenOffline = reader.TlvRecord.ValueAsBoolean();
                        result = true;
                        break;

                    case ResourceID.Binding:
                        TBindingMode binding     = TBindingMode.NotSet;
                        string       bindingText = reader.TlvRecord.ValueAsString();
                        switch (bindingText)
                        {
                        case "U":
                            binding = TBindingMode.UDP;
                            break;

                        case "UQ":
                            binding = TBindingMode.QueuedUDP;
                            break;

                        case "S":
                            binding = TBindingMode.SMS;
                            break;

                        case "SQ":
                            binding = TBindingMode.QueuedSMS;
                            break;

                        case "US":
                            binding = TBindingMode.UDPSMS;
                            break;

                        case "UQS":
                            binding = TBindingMode.QueuedUDPSMS;
                            break;

                        default:
                            break;
                        }
                        this.Binding = binding;
                        result       = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
示例#11
0
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.DeviceID:
                        this.DeviceID = reader.TlvRecord.Value;
                        result        = true;
                        break;

                    case ResourceID.ParentID:
                        this.ParentID = reader.TlvRecord.Value;
                        result        = true;
                        break;

                    case ResourceID.DeviceType:
                        this.DeviceType = reader.TlvRecord.ValueAsString();
                        result          = true;
                        break;

                    case ResourceID.Name:
                        this.Name = reader.TlvRecord.ValueAsString();
                        result    = true;
                        break;

                    case ResourceID.Description:
                        this.Description = reader.TlvRecord.ValueAsString();
                        result           = true;
                        break;

                    case ResourceID.FCAP:
                        this.FCAP = reader.TlvRecord.ValueAsString();
                        result    = true;
                        break;

                    case ResourceID.TenantID:
                        this.TenantID = reader.TlvRecord.ValueAsInt64();
                        result        = true;
                        break;

                    case ResourceID.TenantChallenge:
                        this.TenantChallenge = reader.TlvRecord.Value;
                        result = true;
                        break;

                    case ResourceID.HashIterations:
                        this.HashIterations = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.TenantHash:
                        this.TenantHash = reader.TlvRecord.Value;
                        result          = true;
                        break;

                    case ResourceID.Status:
                        this.Status = reader.TlvRecord.ValueAsInt64();
                        result      = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.NetworkBearer:
                        this.NetworkBearer = reader.TlvRecord.ValueAsInt64();
                        result             = true;
                        break;

                    case ResourceID.AvailableNetworkBearers:
                        this.AvailableNetworkBearers = IntegerResources.Deserialise(reader);
                        result = true;
                        break;

                    case ResourceID.RadioSignalStrength:
                        this.RadioSignalStrength = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.LinkQuality:
                        this.LinkQuality = reader.TlvRecord.ValueAsInt64();
                        result           = true;
                        break;

                    case ResourceID.IPAddresses:
                        this.IPAddresses = StringResources.Deserialise(reader);
                        result           = true;
                        break;

                    case ResourceID.RouterIPAddresses:
                        this.RouterIPAddresses = StringResources.Deserialise(reader);
                        result = true;
                        break;

                    case ResourceID.LinkUtilization:
                        this.LinkUtilization = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.APNs:
                        this.APNs = StringResources.Deserialise(reader);
                        result    = true;
                        break;

                    case ResourceID.CellID:
                        this.CellID = reader.TlvRecord.ValueAsInt64();
                        result      = true;
                        break;

                    case ResourceID.SMNC:
                        this.SMNC = reader.TlvRecord.ValueAsInt64();
                        result    = true;
                        break;

                    case ResourceID.SMCC:
                        this.SMCC = reader.TlvRecord.ValueAsInt64();
                        result    = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
示例#13
0
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.LWM2MServerURI:
                        this.LWM2MServerURI = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.BootstrapServer:
                        this.BootstrapServer = reader.TlvRecord.ValueAsBoolean();
                        result = true;
                        break;

                    case ResourceID.SecurityMode:
                        this.SecurityMode = reader.TlvRecord.ValueAsInt64();
                        result            = true;
                        break;

                    case ResourceID.PublicKeyorIdentity:
                        this.PublicKeyorIdentity = reader.TlvRecord.Value;
                        result = true;
                        break;

                    case ResourceID.ServerPublicKeyorIdentity:
                        this.ServerPublicKeyorIdentity = reader.TlvRecord.Value;
                        result = true;
                        break;

                    case ResourceID.SecretKey:
                        this.SecretKey = reader.TlvRecord.Value;
                        result         = true;
                        break;

                    case ResourceID.SMSSecurityMode:
                        this.SMSSecurityMode = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.SMSBindingKeyParameters:
                        this.SMSBindingKeyParameters = reader.TlvRecord.Value;
                        result = true;
                        break;

                    case ResourceID.SMSBindingSecretKeys:
                        this.SMSBindingSecretKeys = reader.TlvRecord.Value;
                        result = true;
                        break;

                    case ResourceID.LWM2MServerSMSNumber:
                        this.LWM2MServerSMSNumber = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    case ResourceID.ShortServerID:
                        this.ShortServerID = reader.TlvRecord.ValueAsInt64();
                        result             = true;
                        break;

                    case ResourceID.ClientHoldOffTime:
                        this.ClientHoldOffTime = reader.TlvRecord.ValueAsInt64();
                        result = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
示例#14
0
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.Manufacturer:
                        this.Manufacturer = reader.TlvRecord.ValueAsString();
                        result            = true;
                        break;

                    case ResourceID.ModelNumber:
                        this.ModelNumber = reader.TlvRecord.ValueAsString();
                        result           = true;
                        break;

                    case ResourceID.SerialNumber:
                        this.SerialNumber = reader.TlvRecord.ValueAsString();
                        result            = true;
                        break;

                    case ResourceID.FirmwareVersion:
                        this.FirmwareVersion = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.AvailablePowerSources:
                        this.AvailablePowerSources = IntegerResources.Deserialise(reader);
                        result = true;
                        break;

                    case ResourceID.PowerSourceVoltages:
                        this.PowerSourceVoltages = IntegerResources.Deserialise(reader);
                        result = true;
                        break;

                    case ResourceID.PowerSourceCurrents:
                        this.PowerSourceCurrents = IntegerResources.Deserialise(reader);
                        result = true;
                        break;

                    case ResourceID.BatteryLevel:
                        this.BatteryLevel = reader.TlvRecord.ValueAsInt64();
                        result            = true;
                        break;

                    case ResourceID.MemoryFree:
                        this.MemoryFree = reader.TlvRecord.ValueAsInt64();
                        result          = true;
                        break;

                    case ResourceID.ErrorCodes:
                        this.ErrorCodes = IntegerResources.Deserialise(reader);
                        result          = true;
                        break;

                    case ResourceID.CurrentTime:
                        this.CurrentTime = reader.TlvRecord.ValueAsDateTime();
                        result           = true;
                        break;

                    case ResourceID.UTCOffset:
                        this.UTCOffset = reader.TlvRecord.ValueAsString();
                        result         = true;
                        break;

                    case ResourceID.Timezone:
                        this.Timezone = reader.TlvRecord.ValueAsString();
                        result        = true;
                        break;

                    case ResourceID.SupportedBindingandModes:
                        this.SupportedBindingandModes = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.DeviceType:
                        this.DeviceType = reader.TlvRecord.ValueAsString();
                        result          = true;
                        break;

                    case ResourceID.HardwareVersion:
                        this.HardwareVersion = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.SoftwareVersion:
                        this.SoftwareVersion = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.BatteryStatus:
                        this.BatteryStatus = reader.TlvRecord.ValueAsInt64();
                        result             = true;
                        break;

                    case ResourceID.MemoryTotal:
                        this.MemoryTotal = reader.TlvRecord.ValueAsInt64();
                        result           = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }
        public override bool Deserialise(TlvReader reader)
        {
            bool result = false;

            while (reader.Read())
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ObjectInstance)
                {
                    if (string.Compare(this.Name, reader.TlvRecord.Identifier.ToString()) != 0)
                    {
                        this.Name = reader.TlvRecord.Identifier.ToString();
                    }
                    reader = new TlvReader(reader.TlvRecord.Value);
                }
                else if ((reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.ObjectInstance) && (reader.TlvRecord.TypeIdentifier != TTlvTypeIdentifier.NotSet))
                {
                    switch ((ResourceID)reader.TlvRecord.Identifier)
                    {
                    case ResourceID.CommandID:
                        this.CommandID = reader.TlvRecord.Value;
                        result         = true;
                        break;

                    case ResourceID.CommandTypeID:
                        this.CommandTypeID = reader.TlvRecord.ValueAsString();
                        result             = true;
                        break;

                    case ResourceID.Status:
                        this.Status = reader.TlvRecord.ValueAsInt64();
                        result      = true;
                        break;

                    case ResourceID.StatusCode:
                        this.StatusCode = reader.TlvRecord.ValueAsString();
                        result          = true;
                        break;

                    case ResourceID.ParameterName:
                        this.ParameterName = StringResources.Deserialise(reader);
                        result             = true;
                        break;

                    case ResourceID.ParameterValue:
                        this.ParameterValue = StringResources.Deserialise(reader);
                        result = true;
                        break;

                    case ResourceID.ResultContentType:
                        this.ResultContentType = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.ResultContent:
                        this.ResultContent = reader.TlvRecord.ValueAsString();
                        result             = true;
                        break;

                    case ResourceID.ErrorContentType:
                        this.ErrorContentType = reader.TlvRecord.ValueAsString();
                        result = true;
                        break;

                    case ResourceID.ErrorContent:
                        this.ErrorContent = reader.TlvRecord.ValueAsString();
                        result            = true;
                        break;

                    default:
                        break;
                    }
                }
            }
            return(result);
        }