You can refer the following project from github which is a perfect example for your requirement. Kindly go through this and let us know if you have any queries.
You can also go through Day08 Constant broadcaster and Day010 Observer from the link below:
Thanks for Your suggestions
I'm trying to create step by step my own application that should Broadcast i-Beacon Data (with modificable Payload) and scan for external I-Beacons
At the moment I'm trying unsuccessfully to start and Stop Advertisments,
I can stop them but not restart and I can't understand where I'm wrong.
I Attach my Project, can you please Help?