Package ch.ntb.usb

# Class Usb_Endpoint_Descriptor

java.lang.Object
ch.ntb.usb.Usb_Descriptor
ch.ntb.usb.Usb_Endpoint_Descriptor

public class Usb_Endpoint_Descriptor extends Usb_Descriptor
Represents the descriptor of an USB endpoint.
Endpoint descriptors are used to describe endpoints other than endpoint zero. Endpoint zero is always assumed to be a control endpoint and is configured before any descriptors are even requested. The host will use the information returned from these descriptors to determine the bandwidth requirements of the bus.
The length of the configuration descriptor is `Usb_Descriptor.USB_DT_ENDPOINT_SIZE` and the type is `Usb_Descriptor.USB_DT_ENDPOINT`.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`USB_ENDPOINT_ADDRESS_MASK`
Endpoint address mask (in bEndpointAddress).
`static final int`
`USB_ENDPOINT_DIR_MASK`
Endpoint address mask (in bEndpointAddress).
`static final int`
`USB_ENDPOINT_TYPE_BULK`
Possible endpoint types (in bmAttributes).
`static final int`
`USB_ENDPOINT_TYPE_CONTROL`
Possible endpoint types (in bmAttributes).
`static final int`
`USB_ENDPOINT_TYPE_INTERRUPT`
Possible endpoint types (in bmAttributes).
`static final int`
`USB_ENDPOINT_TYPE_ISOCHRONOUS`
Possible endpoint types (in bmAttributes).
`static final int`
`USB_ENDPOINT_TYPE_MASK`
Endpoint type mask (in bmAttributes).
`static final int`
`USB_MAXENDPOINTS`
Maximum number of endpoints

### Fields inherited from class ch.ntb.usb.Usb_Descriptor

`USB_DT_CONFIG, USB_DT_CONFIG_SIZE, USB_DT_DEVICE, USB_DT_DEVICE_SIZE, USB_DT_ENDPOINT, USB_DT_ENDPOINT_AUDIO_SIZE, USB_DT_ENDPOINT_SIZE, USB_DT_HID, USB_DT_HUB, USB_DT_HUB_NONVAR_SIZE, USB_DT_INTERFACE, USB_DT_INTERFACE_SIZE, USB_DT_PHYSICAL, USB_DT_REPORT, USB_DT_STRING`

## Constructor Summary

Constructors
Constructor
Description
`Usb_Endpoint_Descriptor()`

## Method Summary

Modifier and Type
Method
Description
`byte`
`getBEndpointAddress()`
Returns the endpoint address.
Bits 3..0: Endpoint number
Bits 6..4: Reserved.
`byte`
`getBInterval()`
Returns the intervall for polling endpoint data transfers.
Value in frame counts.
`byte`
`getBmAttributes()`
Returns the attributes of this endpoint.
Bits 1..0: Transfer Type (see USB_ENDPOINT_TYPE_XXX).
Bits 7..2: Reserved.
`byte`
`getBRefresh()`
`byte`
`getBSynchAddress()`
`byte[]`
`getExtra()`
Returns the data of extra descriptor(s) if available.
`int`
`getExtralen()`
Returns the number of bytes of the extra descriptor.
`short`
`getWMaxPacketSize()`
Returns the maximum packet size of this endpoint is capable of sending or receiving.
`String`
`toString()`

### Methods inherited from class ch.ntb.usb.Usb_Descriptor

`getBDescriptorType, getBLength`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### USB_MAXENDPOINTS

public static final int USB_MAXENDPOINTS
Maximum number of endpoints

See Also:
  - Constant Field Values

### USB_ENDPOINT_ADDRESS_MASK

public static final int USB_ENDPOINT_ADDRESS_MASK
Endpoint address mask (in bEndpointAddress).

See Also:
  - Constant Field Values

### USB_ENDPOINT_DIR_MASK

public static final int USB_ENDPOINT_DIR_MASK
Endpoint address mask (in bEndpointAddress).

See Also:
  - Constant Field Values

### USB_ENDPOINT_TYPE_MASK

public static final int USB_ENDPOINT_TYPE_MASK
Endpoint type mask (in bmAttributes).

See Also:
  - Constant Field Values

### USB_ENDPOINT_TYPE_CONTROL

public static final int USB_ENDPOINT_TYPE_CONTROL
Possible endpoint types (in bmAttributes).

See Also:
  - Constant Field Values

### USB_ENDPOINT_TYPE_ISOCHRONOUS

public static final int USB_ENDPOINT_TYPE_ISOCHRONOUS
Possible endpoint types (in bmAttributes).

See Also:
  - Constant Field Values

### USB_ENDPOINT_TYPE_BULK

public static final int USB_ENDPOINT_TYPE_BULK
Possible endpoint types (in bmAttributes).

See Also:
  - Constant Field Values

### USB_ENDPOINT_TYPE_INTERRUPT

public static final int USB_ENDPOINT_TYPE_INTERRUPT
Possible endpoint types (in bmAttributes).

See Also:
  - Constant Field Values

## Constructor Details

### Usb_Endpoint_Descriptor

public Usb_Endpoint_Descriptor()

## Method Details

### getBEndpointAddress

public byte getBEndpointAddress()
Returns the endpoint address.
Bits 3..0: Endpoint number
Bits 6..4: Reserved. Set to zero
Bit 7: Direction. 0 = Out, 1 = In (ignored for control endpoints)

Returns:
  the endpoint address

### getBInterval

public byte getBInterval()
Returns the intervall for polling endpoint data transfers.
Value in frame counts. Ignored for Bulk invalid input: '&' Control eEndpoints. Isochronous endpoints must equal 1 and field may range from 1 to 255 for interrupt endpoints.

Returns:
  the intervall for polling endpoint data transfers

### getBmAttributes

public byte getBmAttributes()
Returns the attributes of this endpoint.
Bits 1..0: Transfer Type (see USB_ENDPOINT_TYPE_XXX).
Bits 7..2: Reserved.

            If isochronous endpoint:
                    Bits 3..2: Synchronisation type
                    00 = No synchronisation
                            01 = Asynchronous
              10 = Adaptive
              11 = Synchronous
            Bits 5..4: Usage Type
            00 = Data endpoint
            01 = Feedback endpoint
            10 = Explicit feedback data endpoint
            11 = Reserved

Returns:
  the attributes of this endpoint

### getBRefresh

public byte getBRefresh()

### getBSynchAddress

public byte getBSynchAddress()

### getExtra

public byte[] getExtra()
Returns the data of extra descriptor(s) if available.

Returns:
  null or a byte array with the extra descriptor data

### getExtralen

public int getExtralen()
Returns the number of bytes of the extra descriptor.

Returns:
  the number of bytes of the extra descriptor

### getWMaxPacketSize

public short getWMaxPacketSize()
Returns the maximum packet size of this endpoint is capable of sending or receiving.

Returns:
  the maximum packet size

### toString

public String toString()

Overrides:
  `toString` in class `Object`