Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > IOCTL_ADAPT_SEND_NON_EP0_DIRECT (input) how to tell if the pipe was reset and/or aborted??

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



IOCTL_ADAPT_SEND_NON_EP0_DIRECT (input) how to tell if the pipe was reset and/or aborted??
Moderator:
RSKV

Post Reply
Follow this topic



IOCTL_ADAPT_SEND_NON_EP0_DIRECT (input) how to tell if the pipe was reset and/or aborted??

kechen posted on 07 Nov 2011 7:09 PM PST
Member
2 Forum Posts

Hi,

I have some code to get data from an IN endpoint on the USB

if ( false == ::DeviceIoControl(h, IOCTL_ADAPT_SEND_NON_EP0_DIRECT,
                        pXmitBuf, iXmitBufSize,
                        data, size,
                        &dwReturnBytes, (LPOVERLAPPED)NULL) )

{

  //throw exception

}

The problem is for the very last transfer, no data is passed back, and I do not want the DeviceIoControl to capture anything. The above code will block until sometthing is captured, but I want it to abandon the last capture. I could successfully do that with the IOCTL_ADAPT_RESET_PARENT_PORT. However, that will NOT result in an excpetion being through, as no error condition is reported.

I tried using IOCTL_ADAPT_ABORT_PIPE to force the above code to throw an exception, however, that does not seems to work. Here is how I implmented the abort function

if (false == ::DeviceIoControl(h, IOCTL_ADAPT_ABORT_PIPE,
                        &Address, sizeof(UCHAR),
                        NULL, 0,
                        &dwBytes, NULL))
                    {
                        throw std::exception("LowCyUsbDriver::Reset() - Input pipe IO request cannot be aborted.");
                    }

Is there another function I can use to force the IOCTL_ADAPT_SEND_NON_EP0_DIRECT to report an error state?

 

I really need it to report an error state so I know it has returned from the last capture and nothing should be done about the data that was captured.

 

Thank you!




Re: IOCTL_ADAPT_SEND_NON_EP0_DIRECT (input) how to tell if the pipe was reset and/or aborted??

Gayathri posted on 09 Nov 2011 11:37 PM PST
Cypress Employee
428 Forum Posts

 Hello,

 

Marshal.GetLastWin32Error() returns the error code returned by the last unmanaged function that was called. Please have a look at http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.getlastwin32error.aspx and also the variuos System error codes at: http://msdn.microsoft.com/en-us/library/ms681381.aspx

Please check and let us know whether this proves useful.

 

Regards,

Gayathri






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20