2 Replies Latest reply on Nov 24, 2019 2:30 AM by ClMe_4503246

    PSoC 6 BLE : info about advertising packet

    ClMe_4503246
      Hello everybody!
      I'm using PSoC 6 BLE PROTOTYPING KIT and I configurated it in Broadcaster GAP Role.
      I would like to TURN_ON a pin every time an adv packet is sent and do it at the same time!
      How can I implement it? Is there a way to know when a adv packet is sent?
        • 1. Re: PSoC 6 BLE : info about advertising packet
          NazarP_56

          Hi clme_4503246,


          You can use Cy_BLE_SetCustomEventMask(CY_BLE_ADV_TX_EVENT_MASK) to enable advertisement packet sent events. As result you will receive CY_BLE_EVT_GAP_ADV_TX events when an advertisement packet is sent over the air. You can call Cy_BLE_SetCustomEventMask function in CY_BLE_EVT_STACK_ON event from application BLE callback.

           

          void AppCallBack(uint32_t event, void* eventParam)
          {
              switch (event)
              {
                 
                  case CY_BLE_EVT_STACK_ON: 
                  Cy_BLE_SetCustomEventMask(CY_BLE_ADV_TX_EVENT_MASK);
                  break;
          
                  case CY_BLE_EVT_GAP_ADV_TX: 
                  // Do some processing here...         
                  // NOTE: 
                  // CY_BLE_EVT_GAP_ADV_TX will be generated when adv packet is sent across 1 ADV channel,
                  // so in default configuration ADV comes across 3 ADV channels (37, 38, 39),
                  // so you should count CY_BLE_EVT_GAP_ADV_TX (e.g 3 times) before TURN_ON/OFF a pin.
                  break;
               …
           }
          }
              }      
          }
          


          Regards,
          Nazar

          • 2. Re: PSoC 6 BLE : info about advertising packet
            ClMe_4503246

            Hi
            I tried your code and it works well!
            thank you very much!