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