public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16((int)Id); cmd.AddString(20, LongName); cmd.AddString(4, ShortName); cmd.AddByte(0x00); // Xa cmd.Pad(); // ?? cmd.AddByte((byte)(IsExternal ? 0x00 : 0x01)); // Xb if (ExternalPorts == null) { cmd.AddBoolArray(false); // Is an external type, so no port options } else { cmd.AddBoolArray(ExternalPorts.Contains(ExternalPortType.SDI), ExternalPorts.Contains(ExternalPortType.HDMI), ExternalPorts.Contains(ExternalPortType.Component), ExternalPorts.Contains(ExternalPortType.Composite), ExternalPorts.Contains(ExternalPortType.SVideo)); } cmd.AddByte((byte)(IsExternal ? 0x00 : 0x01)); // Xd cmd.AddUInt8((int)ExternalPortType); // Xe cmd.AddUInt8((int)InternalPortType); cmd.Pad(); //Xg ?? cmd.AddUInt8((uint)SourceAvailability); // Xh cmd.AddUInt8((uint)MeAvailability); // Xi }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddString(32, Name); // TODO figure out what this is. It might mean something, or nothing. By blanking out after the name seems to cause the client to lose input names on the buttons cmd.AddByte(0x28, 0x36, 0x9B, 0x60, 0x4C, 0x08, 0x11, 0x60); cmd.AddUInt8((uint)Model); cmd.AddByte(0x3D, 0xA4, 0x60); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(TransferId); cmd.AddUInt16(Body.Length); cmd.AddByte(Body); }
public override void ToByteArray(ByteArrayBuilder byteArrayBuilder) { byteArrayBuilder .AddByte(Length) .AddByte(DeviceState) .AddInt(Lost); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddBoolArray(Unknown); cmd.AddBoolArray(Unknown2); cmd.AddByte(BytePattern.Take((int)Length)); cmd.PadToNearestMultipleOf4(); }
/// <summary> /// Serialize to ByteArray. /// </summary> /// <param name="byteArrayBuilder">The byte array builder.</param> public override void ToByteArray(ByteArrayBuilder byteArrayBuilder) { byteArrayBuilder .AddByte(Length) .AddByte(this.CommunicationChannel) .AddByte(this.SequenceCounter) .AddByte(0) // reserved .Add(this.Cemi.ToByteArray()); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16((int)Id); cmd.AddString(20, LongName); cmd.AddString(4, ShortName); cmd.AddByte(0x00); // Xa cmd.Pad(); // ?? cmd.AddByte((byte)(IsExternal ? 0x00 : 0x01)); // Xb cmd.AddUInt8((uint)AvailableExternalPorts); cmd.AddByte((byte)(IsExternal ? 0x00 : 0x01)); // Xd cmd.AddUInt8((int)ExternalPortType); // Xe cmd.AddUInt8((int)InternalPortType); cmd.Pad(); //Xg ?? cmd.AddUInt8((uint)SourceAvailability); // Xh cmd.AddUInt8((uint)MeAvailability); // Xi }
/// <summary> /// Toes the byte array. /// </summary> /// <param name="byteArrayBuilder">The byte array builder.</param> public override void ToByteArray(ByteArrayBuilder byteArrayBuilder) { byteArrayBuilder.AddByte(this.CommunicationChannel).AddByte((byte)this.State); if (this.State != ErrorCode.NoError) { return; } byteArrayBuilder.Add(this.HostProtocolAddressInfo.ToByteArray()).AddByte(2) // Length .AddByte((byte)this.ConnectionType); }
public virtual void Serialize(ByteArrayBuilder cmd) { CommandPropertySpec info = GetPropertySpecForType(GetType()); int length = GetLength(); if (length < 0) { throw new SerializationException(GetType().Name, "Cannot auto serialize without a defined length"); } var res = new byte[length]; foreach (PropertySpec prop in info.Properties) { if (prop.Getter != null) { prop.SerAttr.Serialize(cmd.ReverseBytes, res, prop.Attr.StartByte, prop.Getter.DynamicInvoke(this)); } } cmd.AddByte(res); }
/// <summary> /// Serialize to ByteArray. /// </summary> /// <param name="byteArrayBuilder">The byte array builder.</param> public override void ToByteArray(ByteArrayBuilder byteArrayBuilder) { byteArrayBuilder.AddByte(this.Length).AddByte(this.CommunicationChannel).AddByte(this.SequenceCounter). AddByte((byte)this.State); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(Id); cmd.AddByte(0x52, 0x65, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xA4, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x61); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddByte(0x01, 0x00); // ?? cmd.Pad(2); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddUInt16(Id); cmd.AddByte(0x00, 0x0A); }
/// <summary> /// Serialize to ByteArray. /// </summary> /// <param name="byteArrayBuilder">The byte array builder.</param> public override void ToByteArray(ByteArrayBuilder byteArrayBuilder) { byteArrayBuilder.AddByte(this.CommunicationChannel).AddByte((byte)ErrorCode.NoError).Add( this.HostProtocolAddressInfo.ToByteArray()); }
public void Serialize(ByteArrayBuilder cmd) { cmd.AddByte(0x00, 0x00); // ?? cmd.AddByte(0x13, 0x88); // 5000? }