if yes how can i choose between S=2 and S=8, where the change should take place, at the advertising init ?
if yes how can i choose between S=2 and S=8, where the change should take place, at the advertising init ?
Hi.
SoftDevice S140 version 6.1.0 is able to receive at 125 kbps (S=8) and 500 kbps (S=2). But it can only transmit at 125 kbps (S=8).
These rates are fixed, you only have to set your scanning or advertising phys to BLE_GAP_PHY_CODED,
Like this in nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_blinky\main.c :
Line 256: adv_params.primary_phy = BLE_GAP_PHY_1MBPS; Change this line to: adv_params.primary_phy = BLE_GAP_PHY_CODED;
For scanning, you should for example in nRF5_SDK_15.2.0_9412b96\examples\ble_central\ble_app_gatts\, edit scan_phys in m_scan_param in main.c
FROM THIS:
/**< Scan parameters requested for scanning and connection. */
static ble_gap_scan_params_t const m_scan_param =
{
.active = 0x01,
.interval = NRF_BLE_SCAN_SCAN_INTERVAL,
.window = NRF_BLE_SCAN_SCAN_WINDOW,
.filter_policy = BLE_GAP_SCAN_FP_WHITELIST,
.timeout = SCAN_DURATION_WITELIST,
.scan_phys = BLE_GAP_PHY_1MBPS,
};
TO THIS:
/**< Scan parameters requested for scanning and connection. */
static ble_gap_scan_params_t const m_scan_param =
{
.active = 0x01,
.interval = NRF_BLE_SCAN_SCAN_INTERVAL,
.window = NRF_BLE_SCAN_SCAN_WINDOW,
.filter_policy = BLE_GAP_SCAN_FP_WHITELIST,
.timeout = SCAN_DURATION_WITELIST,
.scan_phys = BLE_GAP_PHY_CODED,
};
Best regards,
Andreas
Hi.
SoftDevice S140 version 6.1.0 is able to receive at 125 kbps (S=8) and 500 kbps (S=2). But it can only transmit at 125 kbps (S=8).
These rates are fixed, you only have to set your scanning or advertising phys to BLE_GAP_PHY_CODED,
Like this in nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_blinky\main.c :
Line 256: adv_params.primary_phy = BLE_GAP_PHY_1MBPS; Change this line to: adv_params.primary_phy = BLE_GAP_PHY_CODED;
For scanning, you should for example in nRF5_SDK_15.2.0_9412b96\examples\ble_central\ble_app_gatts\, edit scan_phys in m_scan_param in main.c
FROM THIS:
/**< Scan parameters requested for scanning and connection. */
static ble_gap_scan_params_t const m_scan_param =
{
.active = 0x01,
.interval = NRF_BLE_SCAN_SCAN_INTERVAL,
.window = NRF_BLE_SCAN_SCAN_WINDOW,
.filter_policy = BLE_GAP_SCAN_FP_WHITELIST,
.timeout = SCAN_DURATION_WITELIST,
.scan_phys = BLE_GAP_PHY_1MBPS,
};
TO THIS:
/**< Scan parameters requested for scanning and connection. */
static ble_gap_scan_params_t const m_scan_param =
{
.active = 0x01,
.interval = NRF_BLE_SCAN_SCAN_INTERVAL,
.window = NRF_BLE_SCAN_SCAN_WINDOW,
.filter_policy = BLE_GAP_SCAN_FP_WHITELIST,
.timeout = SCAN_DURATION_WITELIST,
.scan_phys = BLE_GAP_PHY_CODED,
};
Best regards,
Andreas
I am using the ble uart c example
and ble uart example for the next one
each with s140_nrf52_6.1.1_softdevice.hex
tried to add the code from nRF5_SDK_15.2.0_9412b96\examples\ble_central\ble_app_gatts\ to the my ble uart c example , talking about the scan_init and scan_start functions
that is not working !
the functions d_ble_gap_scan_start() returns error 0x0007 - Invalid Parameter
Hi AndreasF , the ble central change worked , but the the ble peripheral didn't.
the change in ble app blinky causes the sd_ble_gap_adv_set_configure() function to return error code 7 , think it is a NRF_ERROR_INVALID_PARAM
what should i change also to make this works for the central and the peripheral ?
Hi.
What do you have in your ble_gap_adv_data_t and ble_gap_adv_params_t structs?
Do you use a whitelist?
NRF_ERROR_INVALID_PARAM occurs when a invalid parameter is supplied to the function call:
* @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied: * - Invalid advertising data configuration specified. See @ref ble_gap_adv_data_t. * - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t. * - Use of whitelist requested but whitelist has not been set, * see @ref sd_ble_gap_whitelist_set.
Best regards,
Andreas
Hi AndreasF,
i saw a solution in here: https://devzone.nordicsemi.com/f/nordic-q-a/37409/sdk15-long-advertising-and-long-range-connect?ReplySortBy=Votes&ReplySortOrder=Descending
used this example for the central: https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c6345b7a087b403b9c50bcb24fdeac27/ble_5F00_app_5F00_uart_5F00_c_5F00_lr.zip
and this example for the peripheral : https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c6345b7a087b403b9c50bcb24fdeac27/ble_5F00_app_5F00_uart_5F00_lr.zip
tested the result distance between two nrf52840 with long range and without (with the regular examples, ble_app_uart and ble_app_uart_c) , but i got the same result!
In both tests gives I got about 75 meters range between the two nrf52840.
in the two test i set the TX power to +8dBm
don't know what is the problem here.
Hi.
I can't compile neither of these projects, and I don't see that you have called sd_ble_gap_adv_set_configure() in either one of them.
Best regards,
Andreas