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

Receving advertisement packets in scanner problem

Hi Team,

                Iam doing project called automation of light using BLE technology.

Here Iam using sdk 12.1.0(ble_app_hrs_c) example for scanning or receiving and i flashed the ble_app_hrs_c example in nRF51822 Dk.This nRF51822Dk acting as receiver. I have nrf51822 beacons ,this beacons acting as transmitter.My beacons can advertise every 1000ms and connection interval 500ms.Till now my project is working fine. my question is

1->When i come with multiple beacons(let us consider 4 beacons) near to receiver or scanner ,does (ble_app_hrs_c) example receives all the advertisement packets from all 4 beacons at regular interval of time. 2->Is there any missing of packets at receiver end?? 3->how can i receive all the advertisement packets in scanner ,do i need to change the scanning interval or connecting,non connecting modes ??

    1. Yes, by default the ble_app_multilink_central example will try to connect to all peripherals that are named "Nordic_Blinky". (it will look for the name in the on_adv_report() function). It will continue to scan and connect until it have connected to the number of peripherals defined by CENTRAL_LINK_COUNT. By default this is set to 8, but can be increased to 20. The CENTRAL_LINK_COUNT is the number of central links used by the application. When changing this number remember to adjust the RAM settings

    2. Yes, the central will scan on all 3 advertising channels (37,39 and 39). When you send an advertising packet from the peripheral, the peripheral will actually send the packet on all 3 advertising channels. It will first send it on channel 37, then on 38 and then on 39.

    image description

  • Note that the ble_app_beacon example is meant to be a pure beacon, where it only does advertising. If you want to connect to the central(in order to e.g. send information from the central to the beacon), I would not recommend using the ble_app_beacon example, but instead use e.g. the experimental_ble_app_blinky example for your peripherals("beacons").

  • Thanks very much .this information is very useful to me.

    one more question ,how can i calculate numbers of ticks does ble_app_hrs_c example can generate in one second.by using this function app_timer_cnt_get(); iam able to receive ticks.by using this how can i calculate the time in seconds only??? by the way iam using nrf51822 Dk.

  • Q: how can i calculate numbers of ticks does ble_app_hrs_c example can generate in one second

    A: You can use the function APP_TIMER_TICKS(..). If you call the function with APP_TIMER_TICKS(1000,APP_TIMER_PRESCALER) it will return the number of ticks for 1000 ms(=1 second).

    The app timer uses the RTC timer, which have a frequency of 32768 Hz. So it wil generate 32768 ticks in 1 second.

  • ok. what does this function returns app_timer_cnt_get().how can i calculate time from this function in one second.

Related