Observing RSSI change on CLBeacon - ios

My purpose is to record the change on RSSI a single beacon.
Firstly i monitor the region of a static UUID, then select the beacon of interest.
So i ended up with one single CLBeacon object. The problem is that, the RSSI value does not change on this object (not surprisingly), i have to find the interest beacon from "..didRangeBeacons:(NSArray *)beacons" each time i need the new RSSI value.
I already tried to use always the pointed object, but i hope there is a convention for that.
I hope my statement is clear, is there a known solution for that ?

Related

Change beacon sending frequency in AltBeacon

I am using the AltBeacon API to send beacons in an Android app. I am using the startRangingBeacon method with the deafult region as an argument -
region = Region("all-beacons", null, null, null).
I know that beacons are sent with the frequency of 1 second. Is it possible to change this frequency?
I tried to search for a frequency variable in the BeaconManager but could not find one.
Simply call:
beaconManager.scanPeriod = 2000L // set callback to 2000ms instead of the default 1100ms
Be aware that increasing the frequency of callbacks will sometimes mean you don’t get detections, as some beacons do not advertise more frequently than once per second. If no detections are made, the callback will have a beacon count of zero.

iOS swift BLE read multiple characteristics

I am trying to design an app that read several temperatures. Is it true that one characteristic UUID can only handle 1 value? If so, how can I read multiple values?(For instance, temperature 1, temperature 2, temperature 3...) Do I need to declare multiple characteristic UUIDs myself? But if I only declare those in my app, how would the peripheral know what UUID corresponds to what value then? Most of the example only read one value (temperature, heart rate,etc)
You can get different values from the same characteristic. For that, you may have to write different values to the write characteristic. For example, say your write characteristic is A and your read characteristic B.
You can write a value to A like this
[self.discoveredPeripheral writeValue:data
forCharacteristic:characteristic
type:CBCharacteristicWriteWithResponse];
where data varies as per the request that you would like to make.
For your read characteristic B, the indication property should be set to YES as follows in the didDiscoverCharacteristicsForService delegate callback
if (c.properties & CBCharacteristicPropertyIndicate) {
[peripheral setNotifyValue:YES forCharacteristic:c];
}
Now whenever you write a value to A, you will get a callback on the delegate method didUpdateValueForCharacteristic. You will have to handle the response properly.
Of course, for all of this to work, your ble device should be programmed accordingly.
Note that the code is written in Objective-C

Interpret Characteristic Properties (iOS and BLE)

I am reading characteristic properties from a BLE device from my iPhone.
However, some of the properties I am seeing (like 0xA, 0x22) are not in the enumerated list that Apple provides. Are these properties a combination of 2 or more enumerated values? Or are these custom properties from the manufacturer? Need guidance on this.
As you can read in the documentation:
Values representing the possible properties of a characteristic. Since
characteristic properties can be combined, a characteristic may have
multiple property values set.
In other words, a characteristic may have more than one property. That makes sense as you can, for example, have a characteristic which can be read (CBCharacteristicPropertyRead) and written to (CBCharacteristicPropertyWrite).
In this case the value of CBCharacteristic's properties would be the bitwise OR of CBCharacteristicPropertyRead and CBCharacteristicPropertyWrite, which is 0xA.

How to store and update past RSSI values in iOS app?

I've developed an iOS app that can read RSSI values from the surrounding Estimote Beacons. These RSSI values are fluctuating and to get a smooth value I need to use a filter. I am trying to use [Kalman filter] which needs some past RSSI values. Now, I am able to get the current RSSI values but cannot store them in database for filtration purpose. How can I store these RSSI values in database? I am using Objective-C for coding.
Thank you.
At the line before you store the current RSSI value, take that value and store it in a similar variable called previousValue or something similar. Then you can do what you wish with it. As it's an NSNumber type, just invoke previousValue.intValue or similar to be able to store the type you need (or just store the NSNumber itself).
If you need more values just add each previousValue to an array variable. You shouldn't need that many previous values though for a Kalman filter, surely.
If you do need to store the data, CoreData or using SQLite directly are two possibilities. Or store the data in a UIDocument. If your question is really asking how to do these things, I would re-state your question. Otherwise there are countless resources for those techniques...

Altitude Disappears from MKPlacemark

So I have some code that gets the user's location from the phone as a CLLocation, then I do a reverse geocode on it. The problem is that the resulting MKPlacemark has 0 for altitude, despite the fact that the CLLocation had a value in the altitude field.
It makes sense that if I just ask for the address of some coordinates, I don't necessarily get altitude (as that would require topographic logic). Most of the questions on here suggest calling out to a topo service.
I am wondering why the reverse geocoder would not just preserve the altitude, and also asking people what their preferred solution has been to this problem. It's not like it's hard to figure out: I can pass the altitude in separately and then just jam it into my ultimate object (my own address class), but that's ugly.
This is indeed the state of these classes at this time. Probably a bug report with Apple is in order.

Resources