Hello, I am trying to switch from BLE_GAP_PHY_AUTO to BLE_GAP_PHY_CODED in runtime, and I need to change central event length via sd_ble_cfg_set(). Whether is it possible to do that after sd_ble_enable() ?
Hello, I am trying to switch from BLE_GAP_PHY_AUTO to BLE_GAP_PHY_CODED in runtime, and I need to change central event length via sd_ble_cfg_set(). Whether is it possible to do that after sd_ble_enable() ?
Hi,
You can initiate a PHY update procedure by calling sd_ble_gap_phy_update(), specifying BLE_GAP_PHY_CODED if you like, and this is done when there is an active connection. Is that what you want to do? Or is it for scanning? If so, then you can also adjust the scan_phys parameter of ble_gap_scan_params_t which you pass when you start scanning. If this does not answer the question, can you elaborate on what you want to do?
Regarding your comment, I don't see the link between event length and PHY (other than that you would need a longer event length to fit the same amount of data in the same duration event with coded PHY relative to 1 Mbps). Can you elaborate? Generally, there is no problem configuring longer event lengths. Using BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN * 2 with any PHY is OK.
The scenario is that device should be able to scan and connect to the regular BT periplerials and to Long-Range peripherials with extended advertizing; the mode (Regular/LongRange) will be chosen programmatically and I want to be able to change it on-the-fly.
I have no issues with regular BT peripherials, I can scan and connect to them; however, when I switch scanning to extended mode and BLE_GAP_PHY_CODED, I can scan for Long-Range peripherial but I'm getting error 19 (NRF_ERROR_RESOURCES) on connect attempt. I have found that for. BLE_GAP_PHY_CODED I should use at least BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN, but I am not sure whether I could keep it for BLE_GAP_PHY_AUTO as well or change it when switching PHY.
The scenario is that device should be able to scan and connect to the regular BT periplerials and to Long-Range peripherials with extended advertizing; the mode (Regular/LongRange) will be chosen programmatically and I want to be able to change it on-the-fly.
I have no issues with regular BT peripherials, I can scan and connect to them; however, when I switch scanning to extended mode and BLE_GAP_PHY_CODED, I can scan for Long-Range peripherial but I'm getting error 19 (NRF_ERROR_RESOURCES) on connect attempt. I have found that for. BLE_GAP_PHY_CODED I should use at least BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN, but I am not sure whether I could keep it for BLE_GAP_PHY_AUTO as well or change it when switching PHY.
Hi,
VladK said:I have found that for. BLE_GAP_PHY_CODED I should use at least BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN, but I am not sure whether I could keep it for BLE_GAP_PHY_AUTO as well or change it when switching PHY.
I see. There should not be any problem using the long event length with any PHY. Configuring longer event lengths means that the SoftDevice RAM usage increases since it needs larger buffers. Also, if you need high throughput, low latency or neither has consequences for choice of event length and connection interval, which are related (since the event must finish within the connection interval). Buth the length is anyway not that long, and you have not written anything about this. So I do not see any practical problems using at least BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN regardless of which PHY is used.
Thanks!