5 Replies Latest reply on May 20, 2014 11:48 AM by userc_5617

    blecm_startAdv() - advInterval <= 128 not working?

      Using Apps/mybeacon, I adjusted the advInterval parameter in blecm_startAdv().

       

      For values of 256, 1024, 2048, I see this relationship when packet sniffing:

      interpacket_ms = 0.625 * advInterval

       

      However, for values of 128 or 32, interpacket_ms = 1277.  Looks like there's a minimum advInterval, between 128 and 256.

       

      How can I set lower inter-packet times?

       

      Also, which docs should I be reading?  I only found this function documented in Doc/API/blecm_8h.html, which gives the signature, but no explanation of the units or limits.

        • 1. Re: blecm_startAdv() - advInterval <= 128 not working?

          Hello asher,

           

          Let me check on the Advertising Interval minimum for you and how to set the time.

           

          With respect to documentation, we document the units and limits within the header files and comments in-lined in the code.

           

          Please send me list of units that you need values for and I will explain the limits.

           

          Thanks,

           

          JT

          • 2. Re: blecm_startAdv() - advInterval <= 128 not working?

            Thanks, JT

             

            I did not see any explanatory comment in blecm.h where blecm_startAdv() is defined.

             

            I mentioned advInterval, in this signature.

             

            Also, what are advAdrType and initiatorAdrType?

            • 3. Re: Re: blecm_startAdv() - advInterval <= 128 not working?

              Hi Asher,

                Yes you are correct there are no inline comments for the blecm_startAdv() API function in blecm.h.  The only example in SDK2.0.1 where this function is used is in the myBeacon example.  In all the other examples the Adv Intervals are defined in the BLE_PROFILE_CFG structure where typically a HIGH and a LOW Advertising interval is set.  The HIGH advertising interval is what the the Adv Interval starts out at and then after a specified time defined for example by .high_undirected_adv_interval the AdvInterval then transitions to the LOW Advertising interval.  For example in the 'hello_sensor' example you have the following values that get loaded into the BLE_PROFILE_CONFIG structure...

               

              /*.high_undirect_adv_interval=*/ 32,  // slots
              /*.low_undirect_adv_interval=*/ 1024, // slots
              /*.high_undirect_adv_duration=*/ 30,  // seconds
              /*.low_undirect_adv_duration=*/ 300,  // seconds

               

              So the AdvInterval starts out at 32*0.625ms = 20ms intervals for a period of 30ms 

              then transitions to the

              LOW AdvInterval of 1024*0.625ms = 64ms for a period of 300ms

               

              All that being said we will need to get you some better documentation on this particular API so you can clearly understand what the variables do/are.

               

              Regards,

              Frank

              1 of 1 people found this helpful
              • 4. Re: Re: blecm_startAdv() - advInterval <= 128 not working?
                VictorZ_46

                Some correction.  When application calls

                  bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, NULL);

                device starts sending advertisement packets with high_undirect_adv_interval interval (in the example it is every 32 slots = 20 msec).  After high_undirect_adv_duration (30 seconds in the example) device slows down and start sending advertisements every low_undirect_adv_interval slots (1024 = 640 msec).  After low_undirect_adv_duration (in the example 300 seconds - 5 minutes).  Function registered in

                 

                bleprofile_regAppEvtHandler(BLECM_APP_EVT_ADV_TIMEOUT,
                is called.  If application still wants to be discoverable it should start

                  bleprofile_Discoverable(LOW_UNDIRECTED_DISCOVERABLE, NULL);

                again

                1 of 1 people found this helpful
                • 5. Re: blecm_startAdv() - advInterval <= 128 not working?

                  Thanks, Frank.  I added a BLE_PROFILE_CFG and removed the call to blecm_startAdv().  The board can now broadcast every 20 ms, which it could not with blecm_startAdv().