Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE Long Range

Hi,

I'm testing a PCA10056 S140 (nrF 52840 PDK), SDK15.

I want to test long range extension : using ble_app_att_mtu_throughput application sample.

But when I change :

.primary_phy   = BLE_GAP_PHY_1MBPS, // Must be changed to connect in long range. (BLE_GAP_PHY_CODED)

by

.primary_phy   = BLE_GAP_PHY_CODED,

I got and NRF_ERROR_INVALID_PARAM during the call to

sd_ble_gap_adv_set_configure

Nothing else modified into the all code. Application working well @1Mbps.

Something missing ? (appart also modifying scan parameters to fitt the same encoding way of advertising).

Bye.

Parents Reply Children
  • Hi,

    OK thank's I can see what I want, and I will be able to play and modify it in the way I want.

    But it's confusing because this code is not the same present in the SDK15 zip file downloaded 2 weeks ago.

    Bye.

  • Hopefully you can make it work. Seems like different engineers like to do it differently, some use the ble_advertisment module to handle the advertisment, while other use the softdevice api to setup advertisment directly without the ble_advertisment module to handle the advertisment.

    Best regards,
    Kenneth

  • Hi,

    The .extended field in the scan_params should be set to 1 :

    static ble_gap_scan_params_t const m_scan_param =
    {
        .active        = 0x00,
        .extended      = 0x01,
        .interval      = SCAN_INTERVAL,
        .window        = SCAN_WINDOW,
        .timeout       = 0x0000, // No timeout.
        .scan_phys     = BLE_GAP_PHY_CODED, //BLE_GAP_PHY_1MBPS,
        .filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
    };

    and the buffer should be defined with a greater value :

    static uint8_t m_scan_buffer_data[BLE_GAP_SCAN_BUFFER_EXTENDED_MIN]; /**< buffer where advertising reports will be stored by the SoftDevice. */
    
    /**@brief Pointer to the buffer where advertising reports will be stored by the SoftDevice. */
    static ble_data_t m_scan_buffer =
    {
        m_scan_buffer_data,
        BLE_GAP_SCAN_BUFFER_EXTENDED_MIN
    };

    After that all done. Thanks.

Related