PreviousNext
Alternative Event Processing
Help > Custom DPA Handler > Events > DPA Request > Alternative Event Processing

There is an optimized macro IfDpaEnumPeripherals_Else_PeripheralInfo_Else_PeripheralRequest() that saves a code compared to the previous way when detecting various cases of the event. The macro is the DPA version independent.

 

case DpaEvent_DpaRequest:

  // Called to interpret DPA Request for peripherals

  IfDpaEnumPeripherals_Else_PeripheralInfo_Else_PeripheralRequest()

  {

    // Peripheral enumeration

    ...

    return TRUE;

  }

  else

  {

    // Get information about peripheral

    ...

    return TRUE;

  }

 

  // Handle peripheral command

  ...

  return TRUE;