6 Replies Latest reply on May 14, 2014 6:46 PM by ArvindS_76 Branched to a new discussion.

    scan sometimes stops working

    dbell

      Sometimes, central scan stops working, and there are no more callbacks for peripheral advertisements (blecm_RegleAdvReportCb), and I have to reset central board to get it going again, and I again get a callback for ad of each peripheral.

       

       

        

      TO START SCAN, I DO THIS:

      blecm_setScanEnable(HCIULP_SCAN_MODE_OFF, blecen_cen_cfg.filter_duplicates);

       

       

        blecm_startScan(blecen_cen_cfg.scan_type,

       

        blecen_cen_cfg.high_scan_interval, blecen_cen_cfg.high_scan_window,

       

        blecen_cen_cfg.scan_adr_type, blecen_cen_cfg.scan_filter_policy,

       

        blecen_cen_cfg.filter_duplicates);

       

       

        

      TO STOP SCAN, I DO THIS:

      blecm_setScanEnable(HCIULP_SCAN_MODE_OFF, blecen_cen_cfg.filter_duplicates);

        • 1. Re: scan sometimes stops working
          MichaelF_56

          Thanks for the response Doug.

          • 2. Re: scan sometimes stops working
            miyac_2166026

            I can't tell by the wording of the post. What was the answer to this issue? To manually stop scanning and re-start it after a period of time?

             

            Mike

            • 3. Re: scan sometimes stops working
              ArvindS_76

              What are your high and low scan parameters? Take the default parameters for instance:

               

              blecen_cen_cfg.high_scan_interval   = 96;   // slots
              blecen_cen_cfg.high_scan_window     = 48;   // slots
              blecen_cen_cfg.high_scan_duration   = 30;   // seconds

               

              blecen_cen_cfg.low_scan_interval    = 2048; // slots
              blecen_cen_cfg.low_scan_window      = 18;   // slots
              blecen_cen_cfg.low_scan_duration    = 300;  // seconds

               

              For the first 30s, the device is scanning at 50% duty cycle and for the next 5 minutes, it is scanning at under 1% duty cycle. So the probability of finding a device that uses undirected advertisement (even at 20mS interval) is quite low (use directed adv instead and the probability increases dramatically). Try changing these parameters (say increase the high scan duration or reduce the low scan interval or increase low scan window) and you will see that you will continue to get adv reports more often.

              • 4. Re: scan sometimes stops working
                userc_2313

                Hi arvinds,

                 

                  Can you elaborate bit more about this statement 'use directed adv instead and the probability increases dramatically'?

                  How does direct advertising increase the probability comparing to undirect type without changing the scan interval and window?

                • 5. Re: scan sometimes stops working
                  ArvindS_76

                  Because with directed adv, the advertiser advertises at near 100% bandwidth. So when the central scans for the 18 slots (11.25mS) every 2048 slots (1.28s) it is guaranteed to get the central's attention. With undirected adv, the adv packet and the scan have to line up just right or you lose another 1.28s.

                  1 of 1 people found this helpful
                  • 6. Re: scan sometimes stops working
                    userc_2313

                    Thanks, arvinds. Also checked on specification, it defines more intensive broadcasting in direct advertising mode.