using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class EnhancedAcceptSynchronousConnectionRequestInfo : PacketInfoBase
{
	public override string Name => "Enhanced Accept Synchronous Connection Request";

	public override string DisplayGroup => "Link Control";

	public EnhancedAcceptSynchronousConnectionRequestInfo(EnhancedAcceptSynchronousConnectionRequest packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		EnhancedAcceptSynchronousConnectionRequest enhancedAcceptSynchronousConnectionRequest = (EnhancedAcceptSynchronousConnectionRequest)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("BD_ADDR", "BD_ADDR of the device requesting the connection.", 48, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.BdAddr, 48), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Transmit_Bandwidth", EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.TransmitBandwidthInfo.TransmitBandwidthToDescription(), 32, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.TransmitBandwidth, 32), EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.TransmitBandwidthInfo.TransmitBandwidthToString(EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.TransmitBandwidthInfo.ValueToTransmitBandwidth(enhancedAcceptSynchronousConnectionRequest.UserFields.TransmitBandwidth)), "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Receive_Bandwidth", EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.ReceiveBandwidthInfo.ReceiveBandwidthToDescription(), 32, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.ReceiveBandwidth, 32), EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.ReceiveBandwidthInfo.ReceiveBandwidthToString(EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.ReceiveBandwidthInfo.ValueToReceiveBandwidth(enhancedAcceptSynchronousConnectionRequest.UserFields.ReceiveBandwidth)), "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Transmit_Coding_Format", "", 40, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.TransmitCodingFormat, 40), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Receive_Coding_Format", "", 40, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.ReceiveCodingFormat, 40), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Transmit_Codec_Frame_Size", EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.TransmitCodecFrameSizeInfo.TransmitCodecFrameSizeToDescription(), 16, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.TransmitCodecFrameSize, 16), EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.TransmitCodecFrameSizeInfo.TransmitCodecFrameSizeToString(EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.TransmitCodecFrameSizeInfo.ValueToTransmitCodecFrameSize(enhancedAcceptSynchronousConnectionRequest.UserFields.TransmitCodecFrameSize)), "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Receive_Codec_Frame_Size", EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.ReceiveCodecFrameSizeInfo.ReceiveCodecFrameSizeToDescription(), 16, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.ReceiveCodecFrameSize, 16), EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.ReceiveCodecFrameSizeInfo.ReceiveCodecFrameSizeToString(EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.ReceiveCodecFrameSizeInfo.ValueToReceiveCodecFrameSize(enhancedAcceptSynchronousConnectionRequest.UserFields.ReceiveCodecFrameSize)), "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Input_Bandwidth", "Host to Controller nominal data rate in octets per second.", 32, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.InputBandwidth, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Output_Bandwidth", "Controller to Host nominal data rate in octets per second.", 32, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.OutputBandwidth, 32), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Input_Coding_Format", "", 40, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.InputCodingFormat, 40), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Output_Coding_Format", "", 40, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.OutputCodingFormat, 40), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Input_Code_Data_Size", "Size, in bits, of the sample or framed data.", 16, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.InputCodeDataSize, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Output_Code_Data_Size", "Size, in bits, of the sample or framed data.", 16, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.OutputCodeDataSize, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Input_PCM_Data_Format", "See Assigned Numbers for PCM_Data_Format.", 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.InputPcmDataFormat, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Output_PCM_Data_Format", "See Assigned Numbers for PCM_Data_Format.", 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.OutputPcmDataFormat, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Input_PCM_Sample_Payload_MSB_Position", "The number of bit positions within an audio sample that the MSB of the sample is away from starting at the MSB of the data.", 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.InputPcmSamplePayloadMsbPosition, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Output_PCM_Sample_Payload_MSB_Position", "The number of bit positions within an audio sample that the MSB of the sample is away from starting at the MSB of the data.", 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.OutputPcmSamplePayloadMsbPosition, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Input_Data_Path", EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.InputDataPathInfo.InputDataPathToDescription(), 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.InputDataPath, 8), EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.InputDataPathInfo.InputDataPathToString(EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.InputDataPathInfo.ValueToInputDataPath(enhancedAcceptSynchronousConnectionRequest.UserFields.InputDataPath)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Output_Data_Path", EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.OutputDataPathInfo.OutputDataPathToDescription(), 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.OutputDataPath, 8), EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.OutputDataPathInfo.OutputDataPathToString(EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.OutputDataPathInfo.ValueToOutputDataPath(enhancedAcceptSynchronousConnectionRequest.UserFields.OutputDataPath)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Input_Transport_Unit_Size", "", 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.InputTransportUnitSize, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Output_Transport_Unit_Size", "", 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.OutputTransportUnitSize, 8), "", "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Max_Latency", "", 16, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.MaxLatency, 16), "", "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Packet_Type", EnhancedSynchronousPacketTypeInfo.EnhancedSynchronousPacketTypeToDescription(), 16, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.PacketType, 16), EnhancedSynchronousPacketTypeInfo.EnhancedSynchronousPacketTypeToString(EnhancedSynchronousPacketTypeInfo.ValueToEnhancedSynchronousPacketType(enhancedAcceptSynchronousConnectionRequest.UserFields.PacketType)), "", "", settable: true, littleEndianTransport: true, omitFromTransport: false, DataEntryMode.RightAlignedHex));
		fieldInfoList.Add(new PacketFieldInfo("Retransmission_Effort", EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.RetransmissionEffortInfo.RetransmissionEffortToDescription(), 8, FormatValue(enhancedAcceptSynchronousConnectionRequest.UserFields.RetransmissionEffort, 8), EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.RetransmissionEffortInfo.RetransmissionEffortToString(EnhancedAcceptSynchronousConnectionRequest.UserFieldsWrapper.RetransmissionEffortInfo.ValueToRetransmissionEffort(enhancedAcceptSynchronousConnectionRequest.UserFields.RetransmissionEffort)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		EnhancedAcceptSynchronousConnectionRequest enhancedAcceptSynchronousConnectionRequest = (EnhancedAcceptSynchronousConnectionRequest)packet;
		int num = -1;
		if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.BdAddr = Convert.ToUInt64(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.TransmitBandwidth = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.ReceiveBandwidth = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.TransmitCodingFormat = Convert.ToUInt64(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.ReceiveCodingFormat = Convert.ToUInt64(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.TransmitCodecFrameSize = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.ReceiveCodecFrameSize = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.InputBandwidth = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.OutputBandwidth = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.InputCodingFormat = Convert.ToUInt64(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.OutputCodingFormat = Convert.ToUInt64(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.InputCodeDataSize = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.OutputCodeDataSize = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.InputPcmDataFormat = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.OutputPcmDataFormat = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.InputPcmSamplePayloadMsbPosition = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.OutputPcmSamplePayloadMsbPosition = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.InputDataPath = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.OutputDataPath = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.InputTransportUnitSize = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.OutputTransportUnitSize = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.MaxLatency = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.PacketType = Convert.ToUInt32(value, 16);
		}
		else if (index == ++num)
		{
			enhancedAcceptSynchronousConnectionRequest.UserFields.RetransmissionEffort = Convert.ToUInt32(value, 16);
		}
	}
}
