1 Reply Latest reply on Oct 13, 2017 2:04 AM by Gyan Chand

    How to register generic event handler

    user_496198631

      Hi everyone,

      in my project i use two generic event handler create from myself and the DIS service.

       

      In my main.c , i start with CyBle_Start(MygenericEventHandler1).

       

      I want to register MygenericEventHandler2 and the Dis Service.

       

      How can i do that ?

       

      I see the function "CyBle_DisRegisterAttrCallback" but what do i put in ()?

       

      Thanks for your advice.

        • 1. Re: How to register generic event handler
          Gyan Chand

          Hello,

           

            You can register the call back for DIS service exactly similar to CyBle_Start() function.

           

          Prototype:-

          MygenericEventHandler1( uint32 event, void* eventParam);

          MygenericEventHandler2( uint32 event, void* eventParam);

           

           

          Call Back Function Call:-

          CyBle_Start(MygenericEventHandler1);

           

          CyBle_DisRegisterAttrCallback(MygenericEventHandler2);

           

           

           

          Call Back Function Define:-

          void MygenericEventHandler1(uint32 event, void *eventParam)

          {

              switch(event)

              {

                 

                  case CYBLE_EVT_STACK_ON:

          .

          .

          .

          .

          .

              }

          }

           

          void MygenericEventHandler2(uint32 event, void *eventParam)

          {

              switch(event)

              {

                 

                  // DIS service specific events

          .

          .

          .

          .

          .

              }

          }

           

           

           

          -Gyan