Module for advanced isochronous transfers. (libusbK only)
More...
|
KUSB_EXP BOOL KUSB_API | IsoK_Init (_out PKISO_CONTEXT *IsoContext, _in INT NumberOfPackets, _inopt INT StartFrame) |
| Creates a new isochronous transfer context for libusbK only. More...
|
|
KUSB_EXP BOOL KUSB_API | IsoK_Free (_in PKISO_CONTEXT IsoContext) |
| Destroys an isochronous transfer context. More...
|
|
KUSB_EXP BOOL KUSB_API | IsoK_SetPackets (_in PKISO_CONTEXT IsoContext, _in INT PacketSize) |
| Convenience function for setting the offset of all ISO packets of an isochronous transfer context. More...
|
|
KUSB_EXP BOOL KUSB_API | IsoK_SetPacket (_in PKISO_CONTEXT IsoContext, _in INT PacketIndex, _in PKISO_PACKET IsoPacket) |
| Convenience function for setting all fields of a KISO_PACKET. More...
|
|
KUSB_EXP BOOL KUSB_API | IsoK_GetPacket (_in PKISO_CONTEXT IsoContext, _in INT PacketIndex, _out PKISO_PACKET IsoPacket) |
| Convenience function for getting all fields of a KISO_PACKET. More...
|
|
KUSB_EXP BOOL KUSB_API | IsoK_EnumPackets (_in PKISO_CONTEXT IsoContext, _in KISO_ENUM_PACKETS_CB *EnumPackets, _inopt INT StartPacketIndex, _inopt PVOID UserState) |
| Convenience function for enumerating ISO packets of an isochronous transfer context. More...
|
|
KUSB_EXP BOOL KUSB_API | IsoK_ReUse (_ref PKISO_CONTEXT IsoContext) |
| Convenience function for re-using an isochronous transfer context in a subsequent request. More...
|
|
Module for advanced isochronous transfers. (libusbK only)
Additional ISO transfer flags.
Enumerator |
---|
KISO_FLAG_SET_START_FRAME |
Do not start the transfer immediately, instead use KISO_CONTEXT::StartFrame.
By default, isochronous transfers start on the next frame and KISO_CONTEXT::StartFrame is ignored. If this flag is specified, the transfer is postponed until the current usb frame number equals that specified by KISO_CONTEXT::StartFrame.
Under certain circumstances, the driver can specify 0 for KISO_CONTEXT::StartFrame, and the bus driver will begin the transaction in the next available frame.
Specifing 0 for KISO_CONTEXT::StartFrame (start transfer ASAP) is restricted to the first transaction on a newly opened or reset pipe. Furthermore, the USB stack contains a bug in Microsoft Windows Server 2003 and Windows XP that limits the use of this to an isochronous context with 255 or fewer packets.
For more information about resetting pipes, see UsbK_ResetPipe.
|
Creates a new isochronous transfer context for libusbK only.
- Parameters
-
- Returns
- On success, TRUE. Otherwise FALSE. Use
GetLastError()
to get extended error information.
IsoK_Init
is performs the following tasks in order:
- Allocates the
IsoContext
and the required KISO_PACKET structures.
- Zero-initializes all ISO context memory.
- Assigns NumberOfPackets, PipeID, and StartFrame to
IsoContext
.
Destroys an isochronous transfer context.
- Parameters
-
[in] | IsoContext | A pointer to an isochronous transfer context created with IsoK_Init. |
- Returns
- On success, TRUE. Otherwise FALSE. Use
GetLastError()
to get extended error information.
Convenience function for setting the offset of all ISO packets of an isochronous transfer context.
- Parameters
-
[in] | IsoContext | A pointer to an isochronous transfer context. |
[in] | PacketSize | The packet size used to calculate and assign the absolute data offset for each KISO_PACKET in IsoContext . |
- Returns
- On success, TRUE. Otherwise FALSE. Use
GetLastError()
to get extended error information.
IsoK_SetPackets
updates all KISO_PACKET::Offset fields in a KISO_CONTEXT so all offset are PacketSize
apart. For example:
- The offset of the first (0-index) packet is 0.
- The offset of the second (1-index) packet is PacketSize.
- The offset of the third (2-index) packet is PacketSize*2.
for (packetIndex = 0; packetIndex < IsoContext->NumberOfPackets; packetIndex++)
IsoContext->IsoPackets[packetIndex].Offset = packetIndex * PacketSize;
Convenience function for setting all fields of a KISO_PACKET.
- Parameters
-
[in] | IsoContext | A pointer to an isochronous transfer context. |
[in] | PacketIndex | The packet index to set. |
[in] | IsoPacket | Pointer to a user allocated KISO_PACKET which is copied into the PKISO_CONTEXT::IsoPackets array at the specified index. |
- Returns
- On success, TRUE. Otherwise FALSE. Use
GetLastError()
to get extended error information.
Convenience function for getting all fields of a KISO_PACKET.
- Parameters
-
[in] | IsoContext | A pointer to an isochronous transfer context. |
[in] | PacketIndex | The packet index to get. |
[out] | IsoPacket | Pointer to a user allocated KISO_PACKET which receives a copy of the ISO packet in the PKISO_CONTEXT::IsoPackets array at the specified index. |
- Returns
- On success, TRUE. Otherwise FALSE. Use
GetLastError()
to get extended error information.
Convenience function for enumerating ISO packets of an isochronous transfer context.
- Parameters
-
[in] | IsoContext | A pointer to an isochronous transfer context. |
[in] | EnumPackets | Pointer to a user supplied callback function which is executed for all ISO packets in IsoContext or until the user supplied callback function returns FALSE . |
[in] | StartPacketIndex | The zero-based ISO packet index to begin enumeration at. |
[in] | UserState | A user defined value which is passed as a parameter to the user supplied callback function. |
- Returns
- On success, TRUE. Otherwise FALSE. Use
GetLastError()
to get extended error information.
Convenience function for re-using an isochronous transfer context in a subsequent request.
- Parameters
-
[in,out] | IsoContext | A pointer to an isochronous transfer context. |
- Returns
- On success, TRUE. Otherwise FALSE. Use
GetLastError()
to get extended error information.
IsoK_ReUse
does the following:
- Zero-initializes the Length and Status fields of all KISO_PACKET structures.
- Zero-initializes the StartFrame and ErrorCount of the KISO_CONTEXT.