Destroys a specified MSPP endpoint.
DWORD mspDestroyEndpoint ( MSPHD ephd )
Argument |
Description |
ephd |
MSPP endpoint handle. |
Return value |
Description |
SUCCESS |
|
CTAERR_BAD_ARGUMENT |
Function argument includes an invalid value or a required pointer argument is NULL. |
CTAERR_INVALID_CTAHD |
Handle is invalid. |
CTAERR_INVALID_HANDLE |
An invalid handle was passed as an argument to this function. |
MSPERR_DRIVER_COMMAND_FAILED |
SPI command has failed. |
MSPERR_ENDPOINT_NOT_ALLOCATED |
MSPP endpoint is defined, but not yet allocated on the board. |
MSPERR_INVALID_HANDLE |
Specified MSPP endpoint is not valid. |
Event |
Description |
MSPEVN_DESTROY_ENDPOINT_DONE |
Generated when an MSPP endpoint is destroyed following a call to mspDestroyEndpoint. The event.value field can contain the following: CTA_REASON_FINISHED MSPRSN_FAILED_TO_DEALLOCATE MSPP service is unable to deallocate on-board resources. The event.objHd indicates the ephd of the destroyed endpoint. |
When called, mspDestroyEndpoint destroys a specified MSPP endpoint, and disables and disconnects the associated connection, if applicable. For more information, refer to Disabling and enabling MSPP endpoints.
mspCreateEndpoint, mspDisableEndpoint
ret = mspDestroyEndpoint(hEp);
if (ret != SUCCESS)
return FAILURE;
// Wait for event
ctaWaitEvent( hCtaQueHd, &Event, CTA_WAIT_FOREVER );
// Check the reason code
if ( Event.id != MSPEVN_DESTROY_ENDPOINT_DONE ||
Event.value != CTA_REASON_FINISHED )
return FAILURE;