Building a Peripheral
Let’s build a full example. You need to have 2 iOS devices. I will show you how to connect 2 iOS devices via Bluetooth and exchange data. Remember to check if your devices are in the above list of the Bluetooth LE compliant devices.
Let’s start with the Peripheral. We need to follow these steps:
Create and start the Peripheral Manager
Setup and publish its services
Advertise the services
Interact with the Central
Create a new Xcode project using the Single-View Application template. Name it BlueServer (use ARC). Once the project is created, add the CoreBluetooth.framework to it. Then, open the ViewController.h file and add the following line: