get RSSI value from peripheralDidUpdateRSSI

I've searched and searched abnd searched, but cannot find any decent documentation on this.


I'm trying to get updated RSSI values from a connected peripheral. The docs say to call peripheral.readRSSI() which will in turn cause the delegate method peripheralDidUpdateRSSI(peripheral: CBPeripheral!, error: NSError!) to be called. Indeed it does that. However, that being said, I can find no way to actually get the RSSI value from the peripheral. peripheral.RSSI was deprecated in iOS 8, and is now nil, so that doesn't work.


As I said, the documentation is very bad on this topic, and I can find no examples, or further information on hwo to ge is value.


Help appreciated.

Answered by Engineer in 21540022

Along with the RSSI property, the delegate method "peripheralDidUpdateRSSI(peripheral: CBPeripheral!, error: NSError!)" has also been deprecated in iOS 8


A call to readRSSI() will now call the delegate method "peripheral(peripheral: CBPeripheral!, didReadRSSI RSSI: NSNumber!, error: NSError!)"


The RSSI is now in a separate parameter.

Accepted Answer

Along with the RSSI property, the delegate method "peripheralDidUpdateRSSI(peripheral: CBPeripheral!, error: NSError!)" has also been deprecated in iOS 8


A call to readRSSI() will now call the delegate method "peripheral(peripheral: CBPeripheral!, didReadRSSI RSSI: NSNumber!, error: NSError!)"


The RSSI is now in a separate parameter.

Given that a peripheral is connected and presumably that the RSSI value is updated each connection interval.

If an application needs high resolution on the update of the RSSI value; how should the readRSSI() and peripheralDidUpdateRSSI combination be used.

I placed readRSSI() in didUpateValueFor and the callback to peripheralDidUpdateRSSI occurs about 90ms later. Ideally I would like the RSSI value when the data arrives (in didUpateValueFor). However there nolonger appears tobe a way todo this?

get RSSI value from peripheralDidUpdateRSSI
 
 
Q