4 Replies Latest reply on Dec 19, 2018 11:43 AM by FNRo_3768601

    Count the number of BLE Advertisement packets sent

    FNRo_3768601

      Is there a way to count the number of BLE Advertisement packets sent out from a broadcaster (PSoC 4 BLE or PSoC 6 BLE) in a given period of time, say before advertisement timeout?

      I want to compare this number with the number of packets received by a BLE observer, over a varying range of distance.

        • 1. Re: Count the number of BLE Advertisement packets sent
          GyanC_36

          You can use CyBle_GappSetNumOfAdvPkts() API for sending a fixed number of adv packets.

           

           

          -Gyan

          • 2. Re: Count the number of BLE Advertisement packets sent
            FNRo_3768601

            Thanks Gyan, this API may be useful for my case.

            Two followup questions though:

            1) For a given dynamic environment, it maybe hard for me to know before hand the number of packets that I have to send, say when the user presses a button to stop the advertising. In that case, I still need to count the packets on fly. Is there a Stack handler event that I can use to trackf each packet sent?

            2) Is the CyBle_GappSetNumOfAdvPkts() API valid for PSoC 6 BLE? I tried variations like Cy_BLE_GAPP_SetNumOfAdvPkts() but could not find the API in my PSoC 6 BLE project. The BLE component is set in 'Broadcaster' role.

             

            -Rohit

            • 3. Re: Count the number of BLE Advertisement packets sent
              GyanC_36

              Hi Rohit,

               

                   You can keep track of number of Advertisement events ( Ex : If you are using all the 3 ADV channels , then every ADV event ,3 ADV packets will be sent over the air).

               

              To do this, you need to register the bless interrupt callback function.

               

              1) For PSoC 4 BLE :- CyBle_RegisterBlessInterruptCallback()

               

              2) For PSOC 6 BLE :- Cy_BLE_RegisterInterruptCallback()

               

               

              Please let me know if it helps for you.

               

              -Gyan

               

               

               

               

              • 4. Re: Count the number of BLE Advertisement packets sent
                FNRo_3768601

                Hi Gyan,

                 

                I tried Cy_BLE_RegisterInterruptCallback() to record the number of advertisement packets sent from a broadcaster, based on number of BLESS interrupts I receive after starting the advertisement. Unfortunately, the numbers reported are way too less than I see on the BLE sniffer. I have accounted for counting three times for sending packets to channel 37,38 and 39 as well as other BLESS interrupts.

                 

                I have raised a Technical support case and hopefully will get this sorted out and shared here. Let me know if you have any ideas on what else I maybe missing.

                 

                Going back to my other question on 'CyBle_GappSetNumOfAdvPkts()', can you provide the correct API name that is used in PSoC 6 BLE and its respective event name?

                 

                -Rohit