7 Replies Latest reply on May 17, 2018 6:46 PM by axel.lin_1746341

    What is the duty cycle setting used by wiced_bt_ble_observe()?

    axel.lin_1746341

      Hi,

      When use wiced_bt_ble_scan() there is a parameter call scan_type,

      so we can set BTM_BLE_SCAN_TYPE_HIGH_DUTY or BTM_BLE_SCAN_TYPE_LOW_DUTY.

      And I can find the corresponding scan interval/window/duration in wiced_bt_cfg_settings_t.

       

      However, with wiced_bt_ble_observe(), I don't find such duty cycle setting.

      So I have no idea what is the duty cycle setting used by wiced_bt_ble_observe().

        • 1. Re: What is the duty cycle setting used by wiced_bt_ble_observe()?
          yssu

          wiced_bt_ble_observe is used to put the device in an Observer role: performs Passive scanning and uses the default values of 2048 (2048*1.25ms = 2560ms)  for scan interval and 18 (18*1.25ms = 22.5ms) for scan window.

          1 of 1 people found this helpful
          • 2. Re: What is the duty cycle setting used by wiced_bt_ble_observe()?
            axel.lin_1746341

            Why not make it allow to set duty cycle setting rather than use default settings?

            • 3. Re: What is the duty cycle setting used by wiced_bt_ble_observe()?
              yssu

              I guess the default values were considered optimal. We will try to enhance the API based on the requests.

               

              Thanks for your feedback.

              • 4. Re: What is the duty cycle setting used by wiced_bt_ble_observe()?
                axel.lin_1746341

                yssu wrote:

                 

                wiced_bt_ble_observe is used to put the device in an Observer role: performs Passive scanning and uses the default values of 2048 (2048*1.25ms = 2560ms)  for scan interval and 18 (18*1.25ms = 22.5ms) for scan window.

                yssu

                 

                Your reply does not match what I observed.

                 

                1) With ENABLE_BT_PROTOCOL_TRACES enabled, I can find below log:

                   It shows Scan Interval : 18, Scan Window : 18

                SENT Command to HCI. Name: HCI_LE_Write_Scan_Parameters  (Hex Code: 0x200b  Param Len: 7) Ctrl(0)

                Parameters

                                               Scan Type : Active Scan (01)

                                           Scan Interval : 18 (0x0012)

                                             Scan Window : 18 (0x0012)

                                            Address Type : Public (00)

                (0x00)

                 

                RCVD Event from HCI. Name: HCI_Command_Complete  (Hex Code: 0x0e  Param Len: 4) Ctrl(0)

                Parameters

                                      Num HCI Cmd Packets : 1 (0x01)

                                                Cmd Code : 0x200b  (HCI_LE_Write_Scan_Parameters)

                                                  Status : Success (0x00)

                 

                2) I don't think the default is Passive scanning, it looks like it is always Active scanning in sdk-6.1.

                   I tried changing .scan_mode = BTM_BLE_SCAN_MODE_PASSIVE in .ble_scan_cfg but it does not work.

                   (It was working in sdk-6.0.1 or older sdks)

                 

                Can you double check these?

                • 5. Re: What is the duty cycle setting used by wiced_bt_ble_observe()?
                  yssu

                  Axel, you are right.

                  Just confirmed that the wiced_bt_ble_observe() API sets both the scan window and scan interval to 18*1.25ms = 22.5ms. Also, it uses Active Scanning.

                   

                  I checked the source, you cannot change these values from application.

                  • 6. Re: What is the duty cycle setting used by wiced_bt_ble_observe()?
                    axel.lin_1746341

                    yssu wrote:

                     

                    Axel, you are right.

                    Just confirmed that the wiced_bt_ble_observe() API sets both the scan window and scan interval to 18*1.25ms = 22.5ms. Also, it uses Active Scanning.

                     

                    I checked the source, you cannot change these values from application.

                    What do you mean by "cannot change these values from application"?

                    The Active Scanning can be enable/disabled in sdk 6.0.1 and ealier sdks.

                    It's clearly a regression.

                    1 of 1 people found this helpful
                    • 7. Re: What is the duty cycle setting used by wiced_bt_ble_observe()?
                      axel.lin_1746341

                      yssu wrote:

                       

                      I checked the source, you cannot change these values from application.

                      The interval, window, active/passive, etc. are configurable if using wiced_bt_ble_scan().

                      So why these values cannot be changed/configured from application if using wiced_bt_ble_observe().

                      The same question was asked 2 years ago on the forum, no improvement so far. That is quite disappointed.