This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE scanner long range

Hello!

i´m enable ble long range like central for scanner beacons,  i can see long range beacons, but only one time, then i need to restart my DK: i use to do this ble_uart_c example adding all of this:

on main:

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


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
};

----------------------------------------------------------------------------------------------

on  ble_evt_handler:

case BLE_GAP_EVT_ADV_REPORT:


printf("\r\n MAC: [%02x:%02x:%02x:%02x:%02x:%02x]",
adv->peer_addr.addr[5], adv->peer_addr.addr[4], adv->peer_addr.addr[3],
adv->peer_addr.addr[2], adv->peer_addr.addr[1], adv->peer_addr.addr[0])

  break;

-----------------------------------------------------------------------------------------------

on start_scan:


ret = sd_ble_gap_scan_start(&m_scan_param, &m_scan_buffer);

------------------------------------------------

on sdk_config:


// <o> NRF_BLE_SCAN_SCAN_PHY - PHY to scan on.

// <0=> BLE_GAP_PHY_AUTO
// <1=> BLE_GAP_PHY_1MBPS
// <2=> BLE_GAP_PHY_2MBPS
// <4=> BLE_GAP_PHY_CODED
// <255=> BLE_GAP_PHY_NOT_SET

#ifndef NRF_BLE_SCAN_SCAN_PHY
#define NRF_BLE_SCAN_SCAN_PHY 4
#endif

i forgot something? or misconfigured?

thanks!

Parents
  • i can see long range beacons, but only one time

     Can you specify what you mean about this? Did you see them at one point, but then changed something in your project and now you're not able to see these beacons anymore? 

    Please check out this modified example project, which should include everything necessary for scanning for long range devices.

    5432.Long_range_15.2.zip

    Best regards,

    Simon

  • Thanks Simonr,

    i read the example, i have a similar code, when i say "i can see long range beacons, but only one time" i´m trying to clarify:

    1._ i have long range beacons working

    2._i have nrf52840 dk working with a long range advertising scanner on it.

    But it stops when a first beacon apeared and the if a iwant to see another beacon or advertising i need to switch off and on the nrf52840 dk.

    This behaviour only shows with BLE_GAP_PHY_CODED if i change it for BLE_GAP_PHY_AUTO, i can scan beacons once and once again. 

    I dont understand why my code only scan 1 device with the BLE_GAP_PHY_CODED enabled,

    I hope I have explained myself better this time.Thanks!

Reply
  • Thanks Simonr,

    i read the example, i have a similar code, when i say "i can see long range beacons, but only one time" i´m trying to clarify:

    1._ i have long range beacons working

    2._i have nrf52840 dk working with a long range advertising scanner on it.

    But it stops when a first beacon apeared and the if a iwant to see another beacon or advertising i need to switch off and on the nrf52840 dk.

    This behaviour only shows with BLE_GAP_PHY_CODED if i change it for BLE_GAP_PHY_AUTO, i can scan beacons once and once again. 

    I dont understand why my code only scan 1 device with the BLE_GAP_PHY_CODED enabled,

    I hope I have explained myself better this time.Thanks!

Children
No Data
Related