You are currently viewing the documentation for:
ECUSB_Packet_WritePacket
USBF_Packet_WritePacket retrieves a pointer to the buffer to be filled with the packet to send.
ECUSB_ErrorCode ECUSB_Packet_WritePacket(
   struct ECUSB_Packet_Function *pPacketFunction,
   BYTE **ppData,
   WORD *pMaximumPacketSize
);
Parameters
pPacketFunction
A pointer to the struct ECUSB_Packet_Function previously initialized by ECUSB_Packet_Init().
ppData
A pointer to a BYTE * which will receive a pointer to a buffer where the new packet should be written.
pMaximumPacketSize
A pointer to a WORD which will receive the maximum size that can be written to the buffer.
Return value
Returns one of the ECUSB error codes (ECUSB_SUCCESS on success)
Remarks
Call ECUSB_Packet_WritePacket to get a pointer to fill with the packet to send. ECUSB_Packet_WritePacket will block until there is a transmit buffer available. Once the buffer has been filled, call ECUSB_PacketWritePacketDone to release the buffer and allow the driver to transmit it. pMaximumPacketSize will be the same as the ECUSB_PACKET_OPT_MAXIMUMPACKETSIZE define. If ECUSB_PACKET_OPT_MAXIMUMPACKETSIZE is not defined it will default to 528 bytes. If you want to be notified when a new packet can be written, supply the m_fnWriteNotificationCallback of the struct ECUSB_Packet_Configuration when calling ECUSB_Packet_Init.
See also