在CyAPI.chm中的CCyUSBEndPoint有关于Endpoint Address和MaxPacketSize说明
Description
Address contains the value of the bEndpointAddress field of the endpoint descriptor returned by the device.
Addresses with the high-order bit set (0x8_) are IN endpoints.
Addresses with the high-order bit cleared (0x0_) are OUT endpoints.
The default control endpoint (ControlEndPt) has Address = 0.
Example
// Find a second bulk IN endpoint in the EndPoints[] array
CCyUSBDevice *USBDevice = new CCyUSBDevice(Handle);
CCyBulkEndPoint *BulkIn2 = NULL;
int eptCount = USBDevice->EndPointCount();
for (int i=1; i<eptCount; i++) {
bool bIn = USBDevice->EndPoints->Address & 0x80;
bool bBulk = (USBDevice->EndPoints->Attributes == 2);
if (bBulk && bIn) BulkIn2 = (CCyBulkEndPoint *) USBDevice->EndPoints;
if (BulkIn2 == BulkInEndPt) BulkIn2 = NULL;
} |