4 Replies Latest reply on Jul 8, 2016 12:30 PM by JacobT_81

    Issue with BLECM_APP_EVT_ADV_TIMEOUT - callback fires every sec

    mickael.toumi_1583836

      I am using SDK 2.2.2/ BCM20737SoC and I found an issue with the advertisement duration/timeout that I cannot explain.

       

      My goal is to set the highest possible value for timeout for a beacon design running with HIGH_UNDIRECTED_DISCOVERABLE. The goal is to limit the number of callbacks being called by the system. The parameter that controls the advertisement duration is called: .high_undirect_adv_duration. It is set at the very beginning when the application is launching. The type for this parameter is UINT16 so we should be able to hardcode a value of 0xFFFF (65535 seconds). This means the callback should be called every ~18h12 or so.

       

      Also I register for the callback in my "create" function as follow:

      bleprofile_regAppEvtHandler(BLECM_APP_EVT_ADV_TIMEOUT, xxxx_yyyy_advertisement_stopped);

       

      Here is the problem experienced.

       

      • If I hardcode .high_undirect_adv_duration = 65535 (seconds) and run the application the callback fires every second.
      • If I hardcode  .high_undirect_adv_duration = 5 (seconds) and run the application, the callback fires properly every 5 seconds.

       

      Doing some investigations I found the limit value being 32768. If I put  .high_undirect_adv_duration =32768 the callback is NOT called every second. If I put .high_undirect_adv_duration =32769 the callback is called every second.

       

      I am not quite sure what is so special about the number 32768. It is currently the maximum value I can set for the advertisement duration.

       

      I would like to hardcode the maximum value:  .high_undirect_adv_duration = 65535 with a callback calling after the 65535 seconds.

       

      Thanks for feedback!