[BUG] Fail to connect on coded PHY if CONFIG_BT_CTLR_PRIVACY=n

If the privacy feature is disabled, calling bt_conn_le_create will change the state to BT_CONN_CONNECTING_SCAN (since bt_dev.le.rl_size == 0) and then call bt_le_scan_update. However, the fact that we are trying to connect on the coded PHY is never relayed to bt_le_scan_update. btle_scan_update calls start_passive_scan which calls start_le_scan_ext but provides parameters for the 1M PHY instead of the coded PHY. Since we aren't scanning on the coded PHY we'll never see the device we are trying to connect to.

Additionally, start_passive_scan uses default parameters for scanning instead of the ones passed to bt_conn_le_create.

Parents
  • Hello Nick,

    Sorry for the long response time we are less in numbers due to summer vacation.

    Can you give me more idea why this passive_scanning should start coded PHY scanning because if its a bug I need to ask it internally. I wanted to know whether you got mixed up with extended advertising and coded PHY because the screenshot doesn't say anything on coded PHY.

    Kind Regards,

    Abhijith

Reply
  • Hello Nick,

    Sorry for the long response time we are less in numbers due to summer vacation.

    Can you give me more idea why this passive_scanning should start coded PHY scanning because if its a bug I need to ask it internally. I wanted to know whether you got mixed up with extended advertising and coded PHY because the screenshot doesn't say anything on coded PHY.

    Kind Regards,

    Abhijith

Children
  • Hi Abhijith,

    The original call that the application makes is to bt_conn_le_create. If we are trying to connect to a device that is only advertising on the coded PHY, we would set our create parameters to only scan on the coded PHY as seen below:

    In bt_conn_le_create, if CONFIG_BT_SMP is enabled but CONFIG_BT_CTLR_PRIVACY isn't (bt_dev.le.rl_size == 0), the state will be set to BT_CONN_CONNECTING_SCAN and bt_le_scan_update will be called.

    Since the state was changed to BT_CONN_CONNECTING_SCAN, start_passive_scan will get called. The problem with this is that we'll never get an advertisement from the device we are trying to connect to since start_passive_scan only scans on the 1M PHY, and therefore we will timeout while waiting for an advertisement from the device that is only advertising on the coded PHY.

Related