using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using skyscraper5.Skyscraper.IO;

namespace skyscraper8.Ieee802_1AB.Model
{
	public class LldpMediaCapabilities
	{
		private readonly ushort capabilities;
		public byte NetworkConnectivity { get; set; }

		public LldpMediaCapabilities(MemoryStream ms)
		{
			capabilities = ms.ReadUInt16BE();
			NetworkConnectivity = ms.ReadUInt8();
		}

		public bool LldpMedCapable => (capabilities & 0x0001) != 0;
		public bool NetworkPolicyCapable => (capabilities & 0x0002) != 0;
		public bool LocationIdentificationCapable => (capabilities & 0x0004) != 0;
		public bool ExtendedPowerViaMdiPse => (capabilities & 0x0008) != 0;
		public bool ExtendedPowerViaMdiPd => (capabilities & 0x0010) != 0;
		public bool InventoryCapable => (capabilities & 0x0020) != 0;
	}
}
