1 // 2 // Copyright (c) 2010-2019 Antmicro 3 // 4 // This file is licensed under the MIT License. 5 // Full license text is available in 'licenses/MIT.txt'. 6 // 7 8 using Antmicro.Renode.Utilities.Packets; 9 10 namespace Antmicro.Renode.Extensions.Utilities.USB 11 { 12 [LeastSignificantByteFirst] 13 public struct DeviceDescriptor 14 { 15 [PacketField] 16 public byte Length; 17 [PacketField] 18 public byte Type; 19 [PacketField] 20 public ushort ProtocolVersion; 21 [PacketField] 22 public byte Class; 23 [PacketField] 24 public byte Subclass; 25 [PacketField] 26 public byte Protocol; 27 [PacketField] 28 public byte MaximumPacketSize; 29 [PacketField] 30 public ushort VendorId; 31 [PacketField] 32 public ushort ProductId; 33 [PacketField] 34 public ushort DeviceReleaseNumber; 35 [PacketField] 36 public byte ManufacturerNameIndex; 37 [PacketField] 38 public byte ProductNameIndex; 39 [PacketField] 40 public byte SerialNumberIndex; 41 [PacketField] 42 public byte NumberOfConfigurations; 43 ToStringAntmicro.Renode.Extensions.Utilities.USB.DeviceDescriptor44 public override string ToString() 45 { 46 return $" Length = {Length}, Type = {Type}, ProtocolVersion = {ProtocolVersion}, Class = {Class}, Subclass = {Subclass}, Protocol = {Protocol}, MaximumPacketSize = {MaximumPacketSize}, VendorId = {VendorId}, ProductId = {ProductId}, DeviceReleaseNumber = {DeviceReleaseNumber}, ManufacturerNameIndex = {ManufacturerNameIndex}, ProductNameIndex = {ProductNameIndex}, SerialNumberIndex = {SerialNumberIndex}, NumberOfConfigurations = {NumberOfConfigurations}"; 47 } 48 } 49 } 50