/* This comparator searches for the next bulk IN or OUT endpoint, or interrupt IN endpoint within the current interface, aborting the search if another interface descriptor is found before the required endpoint (so that it may be compared using a different comparator to determine if it is another CDC class interface). */
uint8_t DComp_NextCDCDataInterfaceEndpoint(void *CurrentDescriptor)
/* This comparator searches for the next bulk IN or OUT endpoint, or interrupt IN endpoint within the current interface, aborting the search if another interface descriptor is found before the required endpoint (so that it may be compared using a different comparator to determine if it is another CDC class interface). */
uint8_t DComp_NextCDCDataInterfaceEndpoint(void *CurrentDescriptor)
{
	USB_Descriptor_Header_t* Header = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Header_t);
	if (Header->Type == DTYPE_Endpoint)
	{
		USB_Descriptor_Endpoint_t* Endpoint = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Endpoint_t);
		if (((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_BULK) ||
		    ((Endpoint->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT))
		{
			return DESCRIPTOR_SEARCH_Found;
		}
	}
	else if (Header->Type == DTYPE_Interface)
	{
		return DESCRIPTOR_SEARCH_Fail;
	}
	return DESCRIPTOR_SEARCH_NotFound;
}