IOUSBPipe



Member Functions

GetBandwidthAvailable

public:

virtual UInt32 GetBandwidthAvailable();

Returns the available bandwidth (in bytes) per frame for isochronous transfers.

Result: maximum number of bytes that a new iso pipe could transfer per frame given current allocations.

GetFrameNumber

public:

virtual UInt64 GetFrameNumber();

Returns the full current frame number of the bus the device is attached to

Result: The frame number.

abort

public:

virtual IOReturn abort(void);

abort a pipe, causing all outstanding I/O to complete with return code kIOReturnAborted


address

public:

virtual USBDeviceAddress address(void);

returns the bus address of the pipe's device


clearStall

public:

virtual IOReturn clearStall(void);

clear any stall.


controlRequest

public:

// Do a control request over a Control pipe, using a memory descriptor virtual IOReturn controlRequest(IOUSBDevRequestDesc *request, IOUSBCompletion *completion = 0);

Make a control request There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

Parameters

NameDescription
requestparameter block for the control request
completiondescribes action to take when the request has been executed

direction

public:

UInt8 direction();

returns the direction of the pipe:kUSBOut/kUSBIn for a bulk or interrupt pipe, kUSBAnyDirn for a control pipe.


endpoint

public:

const IOUSBController::Endpoint * endpoint();

returns a pointer to the Endpoint structure for the pipe.


endpointDescriptor

public:

const IOUSBEndpointDescriptor * endpointDescriptor();

returns the endpoint descriptor for the pipe.


endpointNumber

public:

UInt8 endpointNumber();

returns the endpoint number in the device that the pipe is connected to.


findNextAssociatedDescriptor

public:

virtual const IOUSBDescriptorHeader * findNextAssociatedDescriptor(const void *current, UInt8 type);

Find the next descriptor of the requested type associated with the endpoint.

Parameters

NameDescription
currentDescriptor to start searching from, NULL to start from beginning of list.
typeDescriptor type to search for, or kUSBAnyDesc to return any descriptor type.

read

public:

virtual IOReturn read(IOMemoryDescriptor * buffer, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, IOUSBIsocCompletion * completion = 0);

Read from an isochronous endpoint

Parameters

NameDescription
bufferplace to put the transferred data
frameStartUSB frame number of the frame to start transfer
numFramesNumber of frames to transfer
frameListBytes to transfer and result for each frame
completiondescribes action to take when buffer has been filled

read

public:

virtual IOReturn read(IOMemoryDescriptor * buffer, IOUSBCompletion * completion = 0, IOByteCount * bytesRead = 0);

Read from an interrupt or bulk endpoint

Parameters

NameDescription
bufferplace to put the transferred data
completiondescribes action to take when buffer has been filled
bytesReadreturns total bytes read for synchronous reads

reset

public:

virtual IOReturn reset(void);

reset a pipe, causing all outstanding I/O to complete with return code kIOReturnAborted, and clear any stall.


status

public:

virtual UInt8 status(void);

Get the current state of the pipe (kIOUSBPipeStalled if stalled or 0 if active). We clear a pipe stall as soon as it is detected, so in practice this routine always returns zero


type

public:

UInt8 type();

returns the pipe type: kUSBControl, kUSBBulk or kUSBInterrupt.


write

public:

virtual IOReturn write(IOMemoryDescriptor * buffer, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, IOUSBIsocCompletion * completion = 0);

Write to an interrupt or bulk endpoint

Parameters

NameDescription
bufferplace to get the transferred data
frameStartUSB frame number of the frame to start transfer
numFramesNumber of frames to transfer
frameListBytes to transfer and result for each frame
completiondescribes action to take when buffer has been emptied

write

public:

virtual IOReturn write(IOMemoryDescriptor * buffer, IOUSBCompletion * completion = 0);

Write to an interrupt or bulk endpoint

Parameters

NameDescription
bufferplace to get the transferred data
completiondescribes action to take when buffer has been emptied

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)