Manuals
General operations
USB Device operations
Packet function operations
Serial function operations
Stream function operations
ECUSB_Packet_ReadPacket
ECUSB_Packet_ReadPacket retrieves a pointer to the buffer of a received packet.
ECUSB_ErrorCode ECUSB_Packet_ReadPacket(
struct ECUSB_Packet_Function *pPacketFunction,
BYTE **ppData,
WORD *pPacketSize
);
struct ECUSB_Packet_Function *pPacketFunction,
BYTE **ppData,
WORD *pPacketSize
);
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 the received packet.
pPacketSize
A pointer to a WORD which will receive the size of the received packet.
Return value
Returns one of the ECUSB error codes (ECUSB_SUCCESS on success)
Remarks
ECUSB_Packet_ReadPacket will block until a packet is available. Use ECUSB_Packet_IsPacketAvailable if you want to check if there is a packet available without blocking.
Call ECUSB_Packet_ReadPacketDone when you are done processing the packet to release its buffer.
See also