Reputation: 16720
For context: I'm working on an app where we're considering the use of iBeacon to identify other people nearby who are running the app. Any time that the app is running, the device acts as an iBeacon; when the user takes a particular action, their device will range nearby iBeacons to identify others nearby.
I'm trying to figure out what kind of impact this would have on the battery, to continuously broadcast as an iBeacon. It should be minimal (I mean, the whole point of Bluetooth low energy is that it's low energy, right?), but without running two identical devices side-by-side for a couple hours, one broadcast and one not, I'm not sure how to determine how much it will affect battery life.
I tried using the Energy Diagnostics profile in Instruments, but for Bluetooth, it's just on or off. This only changes if I disable/enable the Bluetooth on the device. Starting or stopping iBeacon broadcasting doesn't change anything. It seems unlikely that broadcasting as an iBeacon adds zero overhead on top of the already-running Bluetooth hardware, but Instruments doesn't give me enough info to know that for sure.
Any ideas?
Upvotes: 0
Views: 341
Reputation: 65005
In making the Android Beacon Library, I had to figure out a way to do similar tests on that platform. The technique I used is brute force enough that it should apply to iOS as well.
I. Put your phone in a state where very little will be going on that is not related to your app.
II. Take a measurement of how much your app drains the battery when transmitting as a beacon:
III. After charging your phone back to 100%, then take a baseline measurement:
The difference in the battery level between III(4) and II(4) is how much extra your phone uses when transmitting as a beacon vs the baseline.
Yes, this technique will take time -- but run the tests overnight, and you can have your answer in 48 hours. (Although you'll have a dead battery two mornings in a row!)
Upvotes: 2