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

NRF52832 SCAN CHANNEL ERROR

Hello,

I used nrf52832 as a scanner.

Now i use it to scan only one tag. And the TAG advertise data addcoring to ble 4.0.

Now i find scan channels are not 37,38,39,37,38,39,.......they are like this: 37 37 37 37....(about 3 seconds)...38 38 38...(about 3 seconds)....39 39 39...(about 3 seconds)..37 37.37........

But it is right by ble sniffer to see the channel map.

My program like it:

static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)

..............................

switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_ADV_REPORT:

data_t adv_data;
// printf("aA\r\n");

ble_gap_evt_adv_report_t adv_report = p_ble_evt->evt.gap_evt.params.adv_report;

// Initialize advertisement report for parsing.
adv_data.p_data = p_ble_evt->evt.gap_evt.params.adv_report.data.p_data;
adv_data.data_len = p_ble_evt->evt.gap_evt.params.adv_report.data.len;

rssi_positive = ~(adv_report.rssi)+0x01; //abs();
ch_number = adv_report.ch_index;

  if((adv_report.peer_addr.addr[5]==0xF4)&&(adv_report.peer_addr.addr[4]==0x32))

{

printf("%d",ch_number);
printf("\r\n");

}

Wait for your reply.

Thanks

LIU

Parents
  • Hi,

    The radio can receive on one channel at a time, and the SoftDevice will use the same channel for the whole scan window (of configurable length). It seems to me that you have a scan window of about 3 seconds, as all advertisement packets within 3 seconds are received on the same channel. If you want to change channel more often, you need to reduce the scan window accordingly, by adjusting the window field in the  ble_gap_scan_params_t instance that you pass to sd_ble_gap_scan_start(). (You may also want to adjust the interval field accordingly, if you want to maintain the same scan duty cycle.)

Reply
  • Hi,

    The radio can receive on one channel at a time, and the SoftDevice will use the same channel for the whole scan window (of configurable length). It seems to me that you have a scan window of about 3 seconds, as all advertisement packets within 3 seconds are received on the same channel. If you want to change channel more often, you need to reduce the scan window accordingly, by adjusting the window field in the  ble_gap_scan_params_t instance that you pass to sd_ble_gap_scan_start(). (You may also want to adjust the interval field accordingly, if you want to maintain the same scan duty cycle.)

Children
Related