Method | Description | |
---|---|---|
Alloc ( int numIsoPackets ) : |
Allocate a libusb transfer with a specified number of isochronous packet descriptors The returned transfer is pre-initialized for you. When the new transfer is no longer needed, it should be freed with Free. Transfers intended for non-isochronous endpoints (e.g. control, bulk, interrupt) should specify an iso_packets count of zero. For transfers intended for isochronous endpoints, specify an appropriate number of packet descriptors to be allocated as part of the transfer. The returned transfer is not specially initialized for isochronous I/O; you are still required to set the MonoUsbTransfer.NumIsoPackets and MonoUsbTransfer.Type fields accordingly. It is safe to allocate a transfer with some isochronous packets and then use it on a non-isochronous endpoint. If you do this, ensure that at time of submission, MonoUsbTransfer.NumIsoPackets is 0 and that type is set appropriately. |
|
Cancel ( ) : MonoUsbError |
Cancels this transfer. |
|
FillBulk ( MonoUsbDeviceHandle devHandle, byte endpoint, |
Helper function to populate the required MonoUsbTransfer properties for a bulk transfer. |
|
FillControl ( MonoUsbDeviceHandle devHandle, |
Helper function to populate the required MonoUsbTransfer properties for a control transfer. Isochronous transfers are not supported on windows. |
|
FillInterrupt ( MonoUsbDeviceHandle devHandle, byte endpoint, |
Helper function to populate the required MonoUsbTransfer properties for an interrupt transfer. |
|
FillIsochronous ( MonoUsbDeviceHandle devHandle, byte endpoint, |
Helper function to populate the required MonoUsbTransfer properties for an isochronous transfer. Isochronous transfers are not supported on windows. |
|
Free ( ) : void |
Frees this transfer. |
|
GetIsoPacketBuffer ( int packet ) : |
Convenience function to locate the position of an isochronous packet within the buffer of an isochronous transfer. This is a thorough function which loops through all preceding packets, accumulating their lengths to find the position of the specified packet. Typically you will assign equal lengths to each packet in the transfer, and hence the above method is sub-optimal. You may wish to use GetIsoPacketBufferSimple instead. |
|
GetIsoPacketBufferSimple ( int packet ) : |
Convenience function to locate the position of an isochronous packet within the buffer of an isochronous transfer, for transfers where each packet is of identical size. This function relies on the assumption that every packet within the transfer is of identical size to the first packet. Calculating the location of the packet buffer is then just a simple calculation: buffer + (packet_size * packet) Do not use this function on transfers other than those that have identical packet lengths for each packet. |
|
IsoPacket ( int packetNumber ) : |
Gets a MonoUsbIsoPacket that represents the specified iso packet descriptor.
|
|
MonoUsbTransfer ( int numIsoPackets ) : System |
Allocate a libusb transfer with a specified number of isochronous packet descriptors The transfer is pre-initialized for you. When the new transfer is no longer needed, it should be freed with Free. Transfers intended for non-isochronous endpoints (e.g. control, bulk, interrupt) should specify an iso_packets count of zero. For transfers intended for isochronous endpoints, specify an appropriate number of packet descriptors to be allocated as part of the transfer. The returned transfer is not specially initialized for isochronous I/O; you are still required to set the MonoUsbTransfer.NumIsoPackets and MonoUsbTransfer.Type fields accordingly. It is safe to allocate a transfer with some isochronous packets and then use it on a non-isochronous endpoint. If you do this, ensure that at time of submission, MonoUsbTransfer.NumIsoPackets is 0 and that type is set appropriately. |
|
SetIsoPacketLengths ( int length ) : void |
Convenience function to set the length of all packets in an isochronous transfer, based on the num_iso_packets field in the transfer structure. |
|
Submit ( ) : MonoUsbError |
Submits this transfer. This functions submits the USB transfer and return immediately. |
|
UniqueName ( ) : String |
Gets a unqiue name for this transfer.
|
Method | Description | |
---|---|---|
MonoUsbTransfer ( |
Creates a new wrapper for transfers allocated by MonoUsbApi.AllocTransfer,
|
public static Alloc ( int numIsoPackets ) : |
||
numIsoPackets | int | number of isochronous packet descriptors to allocate. |
return |
public FillBulk ( MonoUsbDeviceHandle devHandle, byte endpoint, |
||
devHandle | MonoUsbDeviceHandle | handle of the device that will handle the transfer |
endpoint | byte | address of the endpoint where this transfer will be sent |
buffer | data buffer | |
length | int | length of data buffer |
callback | callback function to be invoked on transfer completion | |
userData | user data to pass to callback function | |
timeout | int | timeout for the transfer in milliseconds |
return | void |
public FillControl ( MonoUsbDeviceHandle devHandle, |
||
devHandle | MonoUsbDeviceHandle | handle of the device that will handle the transfer |
controlSetupHandle | the setup packet/control data to transfer. | |
callback | callback function to be invoked on transfer completion | |
userData | user data to pass to callback function | |
timeout | int | timeout for the transfer in milliseconds |
return | void |
public FillInterrupt ( MonoUsbDeviceHandle devHandle, byte endpoint, |
||
devHandle | MonoUsbDeviceHandle | handle of the device that will handle the transfer |
endpoint | byte | address of the endpoint where this transfer will be sent |
buffer | data buffer | |
length | int | length of data buffer |
callback | callback function to be invoked on transfer completion | |
userData | user data to pass to callback function | |
timeout | int | timeout for the transfer in milliseconds |
return | void |
public FillIsochronous ( MonoUsbDeviceHandle devHandle, byte endpoint, |
||
devHandle | MonoUsbDeviceHandle | handle of the device that will handle the transfer |
endpoint | byte | address of the endpoint where this transfer will be sent |
buffer | data buffer | |
length | int | length of data buffer |
numIsoPackets | int | the number of isochronous packets |
callback | callback function to be invoked on transfer completion | |
userData | user data to pass to callback function | |
timeout | int | timeout for the transfer in milliseconds |
return | void |
public GetIsoPacketBuffer ( int packet ) : |
||
packet | int | The packet to return the address of. |
return |
public GetIsoPacketBufferSimple ( int packet ) : |
||
packet | int | The packet to return the address of. |
return |
public IsoPacket ( int packetNumber ) : |
||
packetNumber | int | The iso packet descriptor to return. |
return |
public MonoUsbTransfer ( int numIsoPackets ) : System | ||
numIsoPackets | int | number of isochronous packet descriptors to allocate. |
return | System |
public SetIsoPacketLengths ( int length ) : void | ||
length | int | The length to set in each isochronous packet descriptor. |
return | void |