mspEnableEndpoint

Starts the flow of data processing through the specified MSPP endpoint.

Prototype

DWORD mspEnableEndpoint ( MSPHD ephd )

Argument

Description

ephd

MSPP endpoint handle.

Return values

Return value

Description

SUCCESS

 

CTAERR_BAD_ARGUMENT

Function argument includes an invalid value or a required pointer argument is NULL.

MSPERR_ENDPOINT_IS_ENABLED

MSPP endpoint is already enabled.

CTAERR_INVALID_CTAHD

Handle is invalid.

CTAERR_INVALID_HANDLE

Invalid handle was passed as an argument to this function.

MSPERR_DRIVER_COMMAND_FAILED

SPI command has failed.

MSPERR_ENDPOINT_BUSY

MSPP command arrived while servicing a previous command.

MSPERR_ENDPOINT_NOT_ALLOCATED

MSPP endpoint is defined, but not yet allocated on the board.

MSPERR_INVALID_HANDLE

Specified MSPP endpoint is not valid.

Events

Event

Description

MSPEVN_ENABLE_ENDPOINT_DONE

Generated when the data flow between MSPP endpoints is halted following a call to mspEnableEndpoint.

The event.value field can contain the following:

CTA_REASON_FINISHED

MSPRSN_FAILED_TO_START

MSPP service is unable to start the on-board resource.

The event.objhd indicates the ephd of the enabled endpoint.

Details

Created MSPP endpoints are enabled, by default. When invoking mspEnableEndpoint, specify the endpoint handle (ephd) of the connected endpoint.

mspEnableEndpoint can also be used to re-establish the data flow through a channel that had previously been disabled.

See also

mspCreateEndpoint, mspDisableEndpoint

Example

ret = mspEnableEndPoint( hEp1);
if (ret != SUCCESS)
    return FAILURE;

// Wait for event
ctaWaitEvent( hCtaQueHd, &Event, CTA_WAIT_FOREVER );

// Check the reason code
if ( Event.id    != MSPEVN_ENABLE_ENDPOINT_DONE ||
     Event.value != CTA_REASON_FINISHED )
    return FAILURE;