java.lang.Object
java.lang.Record
net.codecrete.usb.USBControlTransfer
- Record Components:
requestType- request type (bits 5 and 6 ofbmRequestType)recipient- recipient (bits 0–4 ofbmRequestType)request- request code (value between 0 and 255, calledbRequestin USB specification)value- value (value between 0 and 65535, calledwValuein USB specification)index- index (value between 0 and 65535, calledwIndexin USB specification).
public record USBControlTransfer(USBRequestType requestType, USBRecipient recipient, int request, int value, int index)
extends Record
USB control transfer parameters.
See description of "Setup Data" in the chapter "USB Device Requests" of the USB specification for additional information.
For control requests directed to an interface or endpoint,
the lower byte of index contains the interface or endpoint number.
-
Constructor Summary
ConstructorsConstructorDescriptionUSBControlTransfer(USBRequestType requestType, USBRecipient recipient, int request, int value, int index) Creates an instance of aUSBControlTransferrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.Returns the value of therecipientrecord component.intrequest()Returns the value of therequestrecord component.Returns the value of therequestTyperecord component.final StringtoString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
USBControlTransfer
public USBControlTransfer(USBRequestType requestType, USBRecipient recipient, int request, int value, int index) Creates an instance of aUSBControlTransferrecord class.- Parameters:
requestType- the value for therequestTyperecord componentrecipient- the value for therecipientrecord componentrequest- the value for therequestrecord componentvalue- the value for thevaluerecord componentindex- the value for theindexrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
requestType
Returns the value of therequestTyperecord component.- Returns:
- the value of the
requestTyperecord component
-
recipient
Returns the value of therecipientrecord component.- Returns:
- the value of the
recipientrecord component
-
request
public int request()Returns the value of therequestrecord component.- Returns:
- the value of the
requestrecord component
-
value
public int value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-