/// <summary> /// Reads the value from a TLV record. /// </summary> /// <param name="Output">Output.</param> public override void Write(ILwm2mWriter Output) { if (this.value != null) { Output.Write(IdentifierType.Resource, this.ResourceId, this.value); } else { Output.Write(IdentifierType.Resource, this.ResourceId); } }
/// <summary> /// Reads the value from a TLV record. /// </summary> /// <param name="Output">Output.</param> public override void Write(ILwm2mWriter Output) { if (this.refId.HasValue && this.refInstanceId.HasValue) { Output.Write(IdentifierType.Resource, this.ResourceId, this.refId.Value, this.refInstanceId.Value); } else { Output.Write(IdentifierType.Resource, this.ResourceId); } }
/// <summary> /// Reads the value from a TLV record. /// </summary> /// <param name="Output">Output.</param> public override void Write(ILwm2mWriter Output) { if (this.value.HasValue) { long l = this.value.Value; if (this.signed) { if (l >= sbyte.MinValue && l <= sbyte.MaxValue) { Output.Write(IdentifierType.Resource, this.ResourceId, (sbyte)l); } else if (l >= short.MinValue && l <= short.MaxValue) { Output.Write(IdentifierType.Resource, this.ResourceId, (short)l); } else if (l >= int.MinValue && l <= int.MaxValue) { Output.Write(IdentifierType.Resource, this.ResourceId, (int)l); } else { Output.Write(IdentifierType.Resource, this.ResourceId, l); } } else { if (l >= byte.MinValue && l <= byte.MaxValue) { Output.Write(IdentifierType.Resource, this.ResourceId, (sbyte)l); } else if (l >= ushort.MinValue && l <= ushort.MaxValue) { Output.Write(IdentifierType.Resource, this.ResourceId, (short)l); } else if (l >= uint.MinValue && l <= uint.MaxValue) { Output.Write(IdentifierType.Resource, this.ResourceId, (int)l); } else { Output.Write(IdentifierType.Resource, this.ResourceId, l); } } } else { Output.Write(IdentifierType.Resource, this.ResourceId); } }
/// <summary> /// Reads the value from a TLV record. /// </summary> /// <param name="Output">Output.</param> public override void Write(ILwm2mWriter Output) { Output.Write(IdentifierType.Resource, this.ResourceId); }