Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT+ Blood Pressure PCC Best Practices

RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Refer to the javadoc for reference: https://www.thisisant.com/APIassets/Android_ANT_plus_plugins_API/com/dsi/ant/plugins/antplus/pcc/AntPlusBloodPressurePcc.html


Background

The only recommended way to obtain measurements from an ANT+ blood pressure monitor at this time is to use the PCC function requestDownloadMeasurements(...). This function allows you to download the blood pressure monitor's measurement history and optionally monitor it for new readings. Additionally it will keep track of which measurements you have already downloaded in your app and can optionally give you only new files that your app has not downloaded before.

A lot of people have requested good ways to initiate a blood pressure measurement using the app or to read only the current measurement. Unfortunately, the current version of the ANT+ profile does not implement a measurement status broadcast, so there is no way for the app to monitor the current operation or request a new one.

Since the ANT+ profile is currently limited to only interacting with the BPM device's measurement storage, you must use requestDownloadMeasurements(...) with the various flags to get the desired behaviour.


Initialization

Before downloading, we suggest that before using a BPM that apps begin by asking the user if they would like to set the time on the BPM device so future measurements will be set with the correct time. You should notify them that the set time operation will delete all historical data (your app could helpfully offer to download and store all the previous measurements first). Then call requestResetDataAndSetTime(...) with doSetTime=true. This ensures the BPM has the correct time set as we have seen many BPM devices with incorrect timestamps which sets the measurement times wrong.

(Note: If the user refuses to set the time, the existing measurement time may or may not be correct and you will have to decide if you want to use it, or only consume new measurements. If you want to ignore all existing data, download all measurements once, ignore the measurements, then from then on use downloadNewOnly=true)


Downloads

Here are some example use cases for downloads using requestDownloadMeasurements(...):

To download all measurements on device:
set downloadNewOnly=false, monitorForNewMeasurements=false

To download all new measurements that your app hasn't downloaded yet:
set downloadNewOnly=false, monitorForNewMeasurements=false

To download the most recent measurement only:
set downloadNewOnly=true, monitorForNewMeasurements=false to retrieve all new measurements since your last sync (ignore or do what you like with these), then check the timestamps of the files received to find the most recent after the last file is received. You know the last file is received when your IDownloadMeasurementsStatusReceiver receives a FINISHED status code. (Note: Depending on the BPM device the measurements may be stored in most recent measurement is always last, but this is not guaranteed by the profile)

To get the next measurement:
set downloadNewOnly=true, monitorForNewMeasurements=true
You will first receive any existing measurements not downloaded yet, then after your IDownloadMeasurementsStatusReceiver receives a PROGRESS_MONITORING status code, prompt the user to perform the measurement. The measurement will be automatically detected and you will soon receive a new measurement with the new data.      

Signature

Dynastream Developer