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

Advertising and Scanning in one Device

Hi,

I'm programming nRF52833 for my application. I have done to configure my device and it advertised and scanned sequentially. For my application, I advertise and also scan in channel 37. Now, I want to manage the time it advertise and scanning strictly. Does the BLE device take time to switch from advertiser to Scanner and from Scanner to Advertiser? In my main code I wrote like this:

    advertising_start();
    scan_start();

So that means the BLE device will start advertising in channel 37 and after advertising in T(ms) it starts scanning in Scan_Window(ms), right?? 

Thanks,

Best regards, 

Parents
  • Hi,

    I have started looking into this. I might need to get back to you over the weekend if I am not able to figure this out right away.

    I had a brief chat with a more experienced colleague. It was suggested a shorter scan window allows for a more effective scheduling of advertising and scanning.

    Now, I want to manage the time it advertise and scanning strictly.

    Switching between advertising and scanning might take less than a millisecond but I have not checked yet. What is it you want to achieve? Please keep i mind that the Bluetooth LE spec requires the advertising to add a random delay to your advertising intervals(unless you are doing directed advertising(which is more complicated), for more details please see the Bluetooth Core Specification 5.2, Vol. 6, Part B, 4.4.2)).

    You may monitor the delays in various ways. Let us know what you want to do and we might be able to guide you in some way.

    Best Regards,

    Håkon

  • Hi, 

    Thanks for your reply. In my application, I want that in a period of 100ms, my device have to scan and advertise. So that I want to manage advertising and scanning time. Another question, I know that BLE spec requires a random delay, but how can we add that number? We use nrf_delay_ms or are there any APIs to do that for me?

    Thanks,

    Best regards,

Reply Children
Related