How to Advertising and Scan at the same time

hpudream gravatar image

asked 2017-07-17 09:56:37 +0200

updated 2017-07-22 10:56:02 +0200

I am now using 52832 to do a project, need to send a BLE broadcast package first, and then start scan, what examples can I refer to?

Attachment is my TX/RX process,and I need to implement the device B image description

edit retag flag offensive close delete report spam


Nice. So you are defining your own radio timing so you are not really interested about BLE. This almost looks like you want to write your won radio protocol. If you want to stay with BLE and you want to use Nordic stack (Soft Device) - which will save you like 6-12 months of life - then you need to accept natural timings in there. These mean that you can run dual roles and switches between Tx/Rx will be little more complex but in general much much much faster then 1ms. To be specific for Device B:

  • Use any BLE multirole example for inspiration, but in fact you will run one GAP Peripheral/Broadcaster and one GAP Central/Observer role. (1/x)...
endnode ( 2017-07-22 11:13:39 +0200 )editconvert to answer


  • If you set 100% scanning duty cycle for Observer or if you synchronize Adv. interval with Scnanning interval then you should see Soft Device to do Peripheral task (that's short Tx + if your advertisement is scannable then also short Rx, however gap between them is 150us as defined in BT SIG Core spec) and right after it (much faster then 1ms)observer's Rx window starts (which is no way how to really "see" it so you can only imagine it happens;) - length depends on duty cycle you set.

I don't see any problem in implementing this (however I still don't understand where these arbitrary 1ms/2ms gaps are coming from and why;)

endnode ( 2017-07-22 11:16:28 +0200 )editconvert to answer

1 answer

Sort by » oldest newest most voted
endnode gravatar image

answered 2017-07-17 10:21:33 +0200

The exact timing doesn't make much sense and you might get some troubles catching exactly 2ms delay but it should be possible after some fight with the code and testing. When it comes to dual roles you just need to implement both GAP Peripheral and Observer/Central. There are dual BLE role examples in the SDK, you might like BLE relay but in the end you will probably arrive to your own FW code just slightly inspired by these...

edit flag offensive delete publish link more


Thank you, my project is a similar beacon application, the difference is that after the device sends a beacon, it needs to receive a reply (to execute some commands).

xu ( 2017-07-17 12:05:59 +0200 )editconvert to answer

I do understand it but why exactly 2ms? All BT stacks I've seen can multiplex Tx/Rx much faster so letting it on them and just run both roles in parallel should do the job.

endnode ( 2017-07-17 12:45:56 +0200 )editconvert to answer

Are both the Device A and Device B nRF52832 devices ?

I don't think Android or iOS gives you access to the low level of the BLE hardware which would allow you to do this.

Roger Clark ( 2017-07-23 00:20:58 +0200 )editconvert to answer

No,only device B is a nRF52832 device. device A is a locator that is designed by other Company.

xu ( 2017-07-23 08:41:18 +0200 )editconvert to answer

Still what is the meaning of these arbitrary delays? There is nothing like this defined in BT SIG Core spec so why you need them? And if Device B simply follows the spec and logical implementation of BLE functions why just don't use it (meaning it will "listen" sooner then that 1ms after Tx window - whatever that Tx window is - and it might be listening longer)?

endnode ( 2017-07-23 09:21:43 +0200 )editconvert to answer

What's a "locator" ? Do you mean a "beacon"

Roger Clark ( 2017-07-23 12:23:18 +0200 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools



Asked: 2017-07-17 09:56:37 +0200

Seen: 96 times

Last updated: Jul 22