The event is called when a DPA Response (except a response to Get information for more peripherals) is ready to be returned to the device that sent a DPA Request via a network or from the interface master (if applicable). The event handler can inspect or modify the DPA Response even in the way that the error code is returned.
Example
case DpaEvent_BeforeSendingDpaResponse:
// Always adds one more read byte from EEEPROM peripheral and sets it to 0x55
if ( _PNUM == PNUM_EEEPROM && _PCMD == CMD_RAM_READ )
{
_DpaDataLength++;
FSR0 = _DpaMessage.Response.PData + _DpaDataLength - 1;
setINDF0( 0x55 );
}
return Carry;
Example
case DpaEvent_BeforeSendingDpaResponse:
// This example hides even enabled and implemented PNUM_IO peripheral
if ( IsDpaEnumPeripheralsRequest() )
_DpaMessage.EnumPeripheralsAnswer.EmbeddedPers[ PNUM_IO/8 ] &= ~( 1 << ( PNUM_IO % 8 ) );
else
if ( _PNUM == PNUM_IO && _PCMD == CMD_GET_PER_INFO )
_DpaMessage.PeripheralInfoAnswer.PerT = PERIPHERAL_TYPE_DUMMY;
return Carry;