PreviousNext
DpaApiReturnPeripheralError
Help > Custom DPA Handler > DPA API > DpaApiReturnPeripheralError

DpaApiReturnPeripheralError ( uns8 error )

 

This is a macro calling internal API DpaApiSetPeripheralError( error ) to prepare an error DPA Request from the peripheral DPA Request handling code. Then the macro executes return TRUE or FALSE.

 

This simple statement DpaApiReturnPeripheralError( ERROR_DATA_LEN ) using the macro is fully equivalent to the following lines of code:

 

_DpaMessage.ErrorAnswer.ErrN = ERROR_DATA_LEN;

_DpaMessage.ErrorAnswer.PNUMoriginal = _PNUM;

_PNUM = PNUM_ERROR_FLAG;

_DpaDataLength = sizeof( _DpaMessage.ErrorAnswer );

return Carry;

 

The user peripheral can return user error codes. Such code values must lie between ERROR_USER_FROM and ERROR_USER_TO. See Response Codes.

 

See example codes CustomDpaHandler-UserPeripheral.c for more details.