|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--usb.core.Descriptor | +--usb.core.Endpoint
Provides access to a USB endpoint descriptor, structuring device data input or output in a given device configuration. Only one thread at a time may use an endpoint for I/O.
Bulk endpoints look like standard byte I/O streams.
Interrupt endpoints send and receive short buffers directly; at this
writing there is no asynchronous notification framework.
ISO endpoints are not currently supported here.
(ControlMessage
s are effectively device methods.)
Most fields of this descriptor are specified in section 9.6.4 of the USB 1.1 specification.
Field Summary | |
static int |
ENDPOINT_HALT
Endpoint feature selector that sets or clears the halt state. |
Fields inherited from class usb.core.Descriptor |
CLASS_APP_SPECIFIC, CLASS_AUDIO, CLASS_COMM, CLASS_DATA, CLASS_HID, CLASS_HUB, CLASS_MASS_STORAGE, CLASS_PRINTER, CLASS_VENDOR_SPECIFIC, TYPE_CONFIGURATION, TYPE_DEVICE, TYPE_DEVICE_QUALIFIER, TYPE_ENDPOINT, TYPE_HID, TYPE_HUB, TYPE_INTERFACE, TYPE_INTERFACE_POWER, TYPE_OTHER_SPEED, TYPE_PHYSICAL, TYPE_REPORT, TYPE_STRING |
Method Summary | |
void |
clearHalt()
Clears a halt status (stall) on the bulk endpoint. |
int |
getAttributes()
Returns the endpoint attributes (a bitmask describing its type). |
Device |
getDevice()
Returns the device with which this USB object is associated. |
int |
getEndpoint()
Returns an identifier composing the endpoint address and the flag controlling its input. |
int |
getEndpointAddress()
Returns the endpoint address (a number from 0 to 15). |
java.io.InputStream |
getInputStream()
Returns an input stream used to read from this bulk input stream. |
Interface |
getInterface()
Returns the interface with which the endpoint is associated |
int |
getInterval()
Returns interrupt polling interval (in microseconds). |
int |
getMaxPacketSize()
Maximum packet size this endpoint can send or receive. |
java.io.OutputStream |
getOutputStream()
Returns the output stream used to write to this bulk output stream. |
java.lang.String |
getType()
Returns the type of endpoint ("bulk", "iso", or "interrupt"; "control" won't normally be seen). |
boolean |
isInput()
Returns true if this is an input endpoint (data flows to host), false if it is instead an output endpoint (data flows to device). |
byte[] |
recvInterrupt()
Blocks until an interrupt message is sent from device to host, and then returns that message. |
void |
sendInterrupt(byte[] buf)
Sends interrupt message from host to device. |
Methods inherited from class usb.core.Descriptor |
getBCD, getClassName, getDescriptorType, getDescriptorTypeName, getLength, getU16, getU32, getU8, nextDescriptor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ENDPOINT_HALT
Method Detail |
public int getEndpointAddress()
public boolean isInput()
public int getEndpoint()
public int getAttributes()
public java.lang.String getType()
public int getMaxPacketSize()
public int getInterval()
For high speed bulk or contrul OUT endpoints, this value exposes the maximum NAK rate of the endpoint.
public Interface getInterface()
public Device getDevice()
Descriptor
getDevice
in class Descriptor
public java.io.InputStream getInputStream()
maximum
packet size
, which application protocols may rely on.public java.io.OutputStream getOutputStream()
maximum
packet size
, which application protocols may rely on.public byte[] recvInterrupt() throws java.io.IOException
getInterval()
milliseconds.
Examples of such messages include mouse,
keyboard, and joystick events. (Hub events too, but the kernel
driver will always claim those.)
Note: not yet known to work on Linux; this starts with the implementation model that's supposed to work.
public void sendInterrupt(byte[] buf) throws java.io.IOException
maximum size
,
is written in the next available
interrupt slot for this endpoint. (Note that Interrupt "out"
capabilities were added in the 1.1 revision of the USB spec.)
An example of such interrupts: at least one force-feedback
joystick uses them for the feedback.public void clearHalt() throws java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |