Using Persistent Storage to Optimize Power Consumption
Role of persistent storage
Persistent storage involves non-volatile media, such as disk drives, that retain data even when the device is powered off. It differs from non-persistent storage, such as RAM and cache, which lose data during a power cycle.
Persistent storage can retain a file, a block or an object.
Persistent storage in BLE applications
To reduce power consumption in BLE, two types of information can be kept in persistent storage: bonding information and service discovery information.
In the bonding feature of BLE, paired devices store information about each other in a local database. The next time those devices are close, they use that pairing information to encrypt their connection and transfer data.
Bonding information in persistent storage is preserved, even if the devices are powered off, saving the power otherwise required to pair the devices for each session.
Service discovery information
When two BLE devices are paired and connected, each may discover services and characteristics (including characteristic descriptors) of the other, and use them to perform read and write operations.
Consider a wearable device that supports BLP, the Blood Pressure Profile specification of BLE’s Generic Attributes (GATT) services. The device, when worn by an individual, acts as a server, and the individual’s mobile device acts as a client. The mobile device may discover service-related information like notifications or indications from the BLP device and allow them to receive and track the individual’s blood pressure.
If both devices make use of persistent storage, they can easily connect and perform GATT operations without the need to re-discover the service-related information. Instead, each can load the information from persistent storage, allow notifications/indications and receive the characteristic values.
Implementation on the Qualcomm® QCA4020/4024 Platform
In the following scenario, the QCA402x board takes advantage of persistent storage and its position between a mobile device and home devices to reduce power consumption.
With the QCA4020 Development Board Application, the board scans for home devices only when it is connected to the mobile device. In persistent storage, the board stores service-related information for the mobile device and for the home devices from the last time they were paired. When the QCA402x board powers off, it stores the same set of device and pairing information in persistent storage.
Then, on restart, the QCA402x board loads the pairing information for the mobile device and the home devices and connects to them. That eliminates the overhead involved in scanning and saves power.
For more information, consult the Bluetooth core specification 5.0.