summaryrefslogtreecommitdiff
path: root/src/BootloaderVersion.cpp
diff options
context:
space:
mode:
authorJames A. Jerkins <evergreen@jamesjerkinscomputer.com>2021-09-04 15:26:50 -0500
committerJames A. Jerkins <evergreen@jamesjerkinscomputer.com>2021-09-04 15:57:07 -0500
commitc32ba844e04017a3fd31444c384deb3542bd76be (patch)
tree7ccbdfe108dd1b0b7df146606b06fa3c3149474e /src/BootloaderVersion.cpp
parent3e1fe687b82d4df237b7b355fa31cb88713193fc (diff)
Linear decrease of advert rate to conserve battery
Start advertising aggressively when powered on then slow down linearly over 75 seconds. This will conserve battery by not advertising rapidly the whole time we are seeking a connection. The slowest rate is approximately once every 4.5 seconds to balance responsiveness and battery life. We use a fixed advertising duration of 5 seconds and start with a 62.5 ms advertising interval. Every 5 seconds (the advertising duration) we step up to a larger advertising interval (slower advertising). We continue to increase the advertising interval linearly for 75 seconds from the start of advertising. At 75 seconds we have an advertising interval of 4.44 seconds which we keep until connected. A reboot will restart the sequence. When we receive a disconnect event we restart the sequence with fast advertising and then slow down as described above. Note that we are not using the BLE high duty cycle setting to change the advertising rate. The rate is managed by repeatedly setting the minimum and maximum intervals. The linear rate of decrease and the slowest interval size were determined experimentally by the author. The 5.3 Core spec suggests that you not advertise slower than once every 1.2 seconds to preserve responsiveness but we ignored that suggestion.
Diffstat (limited to 'src/BootloaderVersion.cpp')
0 files changed, 0 insertions, 0 deletions