using System;
using QCRPG.Framework;

namespace QCRPG.TSL.BT.Packets;

public class WriteSimplePairingModeInfo : PacketInfoBase
{
	public override string Name => "Write Simple Pairing Mode";

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

	public WriteSimplePairingModeInfo(WriteSimplePairingMode packet)
		: base(packet)
	{
		UpdateFieldInfoFromPacket();
	}

	public override void UpdateFieldInfoFromPacket()
	{
		WriteSimplePairingMode writeSimplePairingMode = (WriteSimplePairingMode)packet;
		fieldInfoList.Clear();
		fieldInfoList.Add(new PacketFieldInfo("Simple Pairing Mode", WriteSimplePairingMode.UserFieldsWrapper.SimplePairingModeInfo.SimplePairingModeToDescription(), 8, FormatValue(writeSimplePairingMode.UserFields.SimplePairingMode, 8), WriteSimplePairingMode.UserFieldsWrapper.SimplePairingModeInfo.SimplePairingModeToString(WriteSimplePairingMode.UserFieldsWrapper.SimplePairingModeInfo.ValueToSimplePairingMode(writeSimplePairingMode.UserFields.SimplePairingMode)), "", "", settable: true, littleEndianTransport: false, omitFromTransport: false, DataEntryMode.RightAlignedHex));
	}

	public override void UpdatePacketFromFieldInfo(int index, string value)
	{
		WriteSimplePairingMode writeSimplePairingMode = (WriteSimplePairingMode)packet;
		int num = -1;
		if (index == ++num)
		{
			writeSimplePairingMode.UserFields.SimplePairingMode = Convert.ToUInt32(value, 16);
		}
	}
}
