Obtaining broadcast values from CLBeaconRegion
In order to use the startAdvertising
method of the CBPeripheralManage
class, we need to know what we're broadcasting. We do this by calling the peripheralDataWithMeasuredPower:
method of
CLBeaconRegion
. The resulting NSMutableDictionary
class can be used with the startAdvertising
method of the CBPeripheralManage
class.
Measured power (TXPower)
Back in Chapter 1, Welcome to iBeacon, we discussed RSSI and measured power to adjust the power of the transmission so that the distance could be better understood. We'll put this principle into effect during the tutorial by using the measured power of -63 dBm, which should give the correct RSSI value at distance of 1 meter. This might not be completely accurate as it's hardware-dependent, but it should be pretty close.
Let's get started
To build our app, we need two devices. One device should be running the tutorial from Chapter 2, Detecting Beacons – Showing an Advert as a receiver...