1 // *******************************************************************************
    2 //   Custom DPA Handler code example - LEDR on                                   *
    3 // *******************************************************************************
    4 // Copyright (c) IQRF Tech s.r.o.
    5 //
    6 // File:    $RCSfile: CustomDpaHandler-LED-Red-On.c,v $
    7 // Version: $Revision: 1.14 $
    8 // Date:    $Date: 2018/10/25 09:51:28 $
    9 //
   10 // Revision history:
   11 //   2018/10/25  Release for DPA 3.03
   12 //   2017/03/13  Release for DPA 3.00
   13 //   2016/02/03  Release for DPA 2.26
   14 //
   15 // *******************************************************************************
   16 
   17 // Online DPA documentation http://www.iqrf.org/DpaTechGuide/
   18 
   19 // Default IQRF header
   20 #include "IQRF.h"
   21 
   22 // Default DPA headers
   23 #include "DPA.h"
   24 #include "DPAcustomHandler.h"
   25 
   26 // Small diagnostic handler, useful for testing of uploading handlers using CMD_OS_LOAD_CODE
   27 
   28 //############################################################################################
   29 bit CustomDpaHandler()
   30 {
   31   // Handler presence mark
   32   clrwdt();
   33 
   34   if ( GetDpaEvent() == DpaEvent_Idle )
   35     setLEDR();
   36   else if ( GetDpaEvent() == DpaEvent_DpaRequest && IsDpaEnumPeripheralsRequest() )
   37   {
   38     _DpaMessage.EnumPeripheralsAnswer.HWPID = 0xDDDF;
   39     _DpaMessage.EnumPeripheralsAnswer.HWPIDver = 0xDDDF;
   40     return TRUE;
   41   }
   42 
   43   return FALSE;
   44 }
   45 
   46 //############################################################################################
   47 #include "DPAcustomHandler.h"
   48 //############################################################################################