using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class SetMwsSignalingInfo : PacketInfoBase
{
	public override string Name => "Set Mws Signaling";

	public override string DisplayGroup => "Host Control and Baseband";

	public SetMwsSignalingInfo(SetMwsSignaling packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		SetMwsSignaling setMwsSignaling = (SetMwsSignaling)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("MWS_RX_Assert_Offset", "MWS_RX signal assert offset in microseconds (signed integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsRxAssertOffset, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_RX_Assert_Jitter", "MWS_RX signal assert jitter in microseconds (unsigned integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsRxAssertJitter, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_RX_Deassert_Offset", "MWS_RX signal de-assert offset in microseconds (signed integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsRxDeassertOffset, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_RX_Deassert_Jitter", "MWS_RX signal de-assert jitter in microseconds (unsigned integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsRxDeassertJitter, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_TX_Assert_Offset", "MWS_TX signal assert offset in microseconds (signed integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsTxAssertOffset, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_TX_Assert_Jitter", "MWS_TX signal assert jitter in microseconds (unsigned integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsTxAssertJitter, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_TX_Deassert_Offset", "MWS_TX signal de-assert offset in microseconds (signed integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsTxDeassertOffset, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_TX_Deassert_Jitter", "MWS_TX signal de-assert jitter in microseconds (unsigned integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsTxDeassertJitter, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_Pattern_Assert_Offset", "MWS_PATTERN signal assert offset in microseconds (signed integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsPatternAssertOffset, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_Pattern_Assert_Jitter", "MWS_PATTERN signal assert jitter in microseconds (unsigned integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsPatternAssertJitter, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_Inactivity_Duration_Assert_Offset", "MWS_INACTIVITY_DURATION signal assert offset in microseconds (signed integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsInactivityDurationAssertOffset, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_Inactivity_Duration_Assert_Jitter", "MWS_INACTIVITY_DURATION signal assert jitter in microseconds (unsigned integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsInactivityDurationAssertJitter, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_Scan_Frequency_Assert_Offset", "MWS_SCAN_FREQUENCY signal assert offset in microseconds (signed integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsScanFrequencyAssertOffset, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_Scan_Frequency_Assert_Jitter", "MWS_SCAN_FREQUENCY signal assert jitter in microseconds (unsigned integer).", 16, FormatValue(setMwsSignaling.UserFields.MwsScanFrequencyAssertJitter, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("MWS_Priority_Assert_Offset_Request", "Minimum advance notification from the beginning of an MWS Uplink period in microseconds (unsigned integer) before which the BLUETOOTH_RX_PRI or 802_RX_PRI signal shall be asserted to be recognized by the MWS.", 16, FormatValue(setMwsSignaling.UserFields.MwsPriorityAssertOffsetRequest, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		SetMwsSignaling setMwsSignaling = (SetMwsSignaling)packet;
		int num = -1;
		if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsRxAssertOffset = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsRxAssertJitter = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsRxDeassertOffset = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsRxDeassertJitter = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsTxAssertOffset = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsTxAssertJitter = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsTxDeassertOffset = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsTxDeassertJitter = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsPatternAssertOffset = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsPatternAssertJitter = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsInactivityDurationAssertOffset = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsInactivityDurationAssertJitter = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsScanFrequencyAssertOffset = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsScanFrequencyAssertJitter = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			setMwsSignaling.UserFields.MwsPriorityAssertOffsetRequest = Convert.ToUInt32(value, 16);
		}
	}
}
